View previous topic :: View next topic |
Author |
Message |
JohnTheCoolingFan n00b
Joined: 24 Jan 2024 Posts: 23
|
Posted: Sat Feb 17, 2024 5:18 pm Post subject: [SOLVED] docker: 'init' is not a docker command |
|
|
Is init subcommand available in the app-containers/docker-cli-24.0.5? If so, how can I get it installed?
Last edited by JohnTheCoolingFan on Mon Feb 26, 2024 9:37 am; edited 1 time in total |
|
Back to top |
|
|
spica Guru
Joined: 04 Jun 2021 Posts: 329
|
|
Back to top |
|
|
JohnTheCoolingFan n00b
Joined: 24 Jan 2024 Posts: 23
|
Posted: Wed Feb 21, 2024 7:04 am Post subject: |
|
|
I don't want to install a big GUI app which I will never use except for a simple CLI subcommand. Plus it's not available in repositories or overlays (as far as I've searched) and flatpak (flathub). |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 425 Location: Naarm/Melbourne, Australia
|
Posted: Wed Feb 21, 2024 10:38 am Post subject: |
|
|
What spica is saying is that Docker Desktop is the software that provides 'docker init', as described on this post on the Docker blog:
Quote: | To use docker init, developers need to upgrade to the version 4.19.0 or later of Docker Desktop and execute the command in the target project folder. |
Given what you've said about it not being available in the places you mentioned, i imagine you'd need to download and install it from the relevant page on the Docker site. (Though note, i'm not a Docker user myself, so maybe an actual Docker user has a better suggestion.) |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22578
|
Posted: Wed Feb 21, 2024 3:49 pm Post subject: |
|
|
Could you explain why you want this subcommand at all? If it is not part of the basic docker install, it seems like you should not need it. |
|
Back to top |
|
|
JohnTheCoolingFan n00b
Joined: 24 Jan 2024 Posts: 23
|
Posted: Wed Feb 21, 2024 3:50 pm Post subject: |
|
|
Hu wrote: | Could you explain why you want this subcommand at all? If it is not part of the basic docker install, it seems like you should not need it. |
It's useful to initialize basic docker files in a project, such as Dockerfile, .dockerignore and docker-compose.yml. |
|
Back to top |
|
|
spica Guru
Joined: 04 Jun 2021 Posts: 329
|
Posted: Wed Feb 21, 2024 5:56 pm Post subject: |
|
|
JohnTheCoolingFan wrote: | Hu wrote: | Could you explain why you want this subcommand at all? If it is not part of the basic docker install, it seems like you should not need it. |
It's useful to initialize basic docker files in a project, such as Dockerfile, .dockerignore and docker-compose.yml. |
Well, its all about copying the same four files again and again at the end. It is much better to follow the independent approach and collect own templates tailored to fit your requirements, than letting other people dictate their habits. Those who make hammers don't always successfully drive nails, to be honest.
And finally you can tailor a wrapper which mimics to the original user interface, something like this one, it is not ideal, but will cover 99.9% of your routine:
~/bin/docker-wrapper.sh
Code: | if [[ "x${1}x" == "xinitx" ]]
then
copy -r "~/my_templates/${2}" .
else
\docker $@
fi | Add an alias Code: | alias docker=~/bin/docker-wrapper.sh | And finally you can use is as follows: |
|
Back to top |
|
|
JohnTheCoolingFan n00b
Joined: 24 Jan 2024 Posts: 23
|
Posted: Mon Feb 26, 2024 9:36 am Post subject: |
|
|
Thanks for the responses. I hoped there would be a way to install the subcomand without using wrapper scripts or installing the desktop app. I'll probably just use the files I have from otehr projects and some I'll have to learn to make, like docker-compose.yml. |
|
Back to top |
|
|
|