Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] docker: 'init' is not a docker command
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
JohnTheCoolingFan
n00b
n00b


Joined: 24 Jan 2024
Posts: 14

PostPosted: Sat Feb 17, 2024 5:18 pm    Post subject: [SOLVED] docker: 'init' is not a docker command Reply with quote

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
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 288

PostPosted: Mon Feb 19, 2024 3:58 am    Post subject: Reply with quote

Docker Desktop provides the docker init CLI command
Back to top
View user's profile Send private message
JohnTheCoolingFan
n00b
n00b


Joined: 24 Jan 2024
Posts: 14

PostPosted: Wed Feb 21, 2024 7:04 am    Post subject: Reply with quote

spica wrote:
Docker Desktop provides the docker init CLI command


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
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Wed Feb 21, 2024 10:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21644

PostPosted: Wed Feb 21, 2024 3:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
JohnTheCoolingFan
n00b
n00b


Joined: 24 Jan 2024
Posts: 14

PostPosted: Wed Feb 21, 2024 3:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
spica
Apprentice
Apprentice


Joined: 04 Jun 2021
Posts: 288

PostPosted: Wed Feb 21, 2024 5:56 pm    Post subject: Reply with quote

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:
Code:
docker init python
Back to top
View user's profile Send private message
JohnTheCoolingFan
n00b
n00b


Joined: 24 Jan 2024
Posts: 14

PostPosted: Mon Feb 26, 2024 9:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum