void-docs icon indicating copy to clipboard operation
void-docs copied to clipboard

Docker: Moved page from wiki and added to it.

Open ghost opened this issue 5 years ago • 53 comments

Moved Docker info from wiki to void-docs. Added a little about void-linux docker images.

ghost avatar Mar 05 '20 03:03 ghost

Not sure what failed. Tell me what I need to fix and I will

ghost avatar Mar 05 '20 03:03 ghost

Following the "Details" link next to "The Travis CI build failed", it looks like you might not have run the file through vmdfmt, as per the Handbook style guide.

Also, the style guide notes:

when writing documentation for the foo package, do not provide a command code-block stating that one should install it via xbps-install foo.

flexibeast avatar Mar 05 '20 04:03 flexibeast

@flexibeast Thanks, I i will fix it. I was using mdbook to view it and assume mdbook build ran it thourh vmdfmt as well.

ghost avatar Mar 05 '20 04:03 ghost

My bad on needing to force it twice. Forgot to git add the changes. Should look a lot better now too. Let me know what you think.

ghost avatar Mar 05 '20 05:03 ghost

Firstly, thanks for taking the time to work on porting content from the wiki!

i'm not a member of the Void team, myself, so i'm not in a position to make an 'official' review, but for what it's worth, here are some initial thoughts:

  1. There are several typos in the PR: 'deplay' rather than 'deploy', 'reosurces' rather than 'resources', 'folllowing' rather than 'following', 'adiition' rather than 'addition', 'diplayed' rather than 'displayed', 'docker' rather than 'Docker' (when not referring to the docker command or group), 'void' rather than 'Void', 'linux' rather than 'Linux'.

  2. i'm not sure the text:

It has become increasingly popular because it can be used to deplay large number of containers quickly, easily, and scales well. It also uses less reosurces than a typical VM.

should be included; it sounds more like promotional material than technical documentation.

  1. As per the style guide, references to standard calls to xbps-install, as on line 17, are not needed.

  2. The text:

To install docker, and optionally, docker-compose run the folllowing command. Docker Compose is a tool to create and run multi-container Docker apps. After the install, be sure to enable and start the service before trying to use it. If it is not enabled, it will not work. In adiition, you will need to add your user to the docker group.

# xbps-install -S docker docker-compose # ln -s /etc/sv/docker /var/service # usermod -aG docker $USER

could be shortened to:

After installing the docker package (and optionally, the docker-compose package), enable the docker service:

# ln -s /etc/sv/docker /var/service

and add your user to the docker group:

# usermod -aG docker $USER

  1. i'm not sure it's necessary for the documentation to include checking whether the docker command is available post-installation, but if so, this could all be shortened down to $ docker -v, rather than including docker help output.

Obviously the typos can be corrected immediately, but the other suggestions i made should wait on any comment(s) by a member of the Void team.

flexibeast avatar Mar 05 '20 07:03 flexibeast

I will go ahead and make the changes you pointed out as I agree with all accounts. Thanks! I'll check back in after the changes!

ghost avatar Mar 06 '20 02:03 ghost

Think it looks a lot better per your suggestions. Thanks

ghost avatar Mar 07 '20 02:03 ghost

  • Line 4 has 'visualisation' instead of 'virtualisation'.
  • Line 8: the first instance of docker should be in backticks (`) rather than straight quotes.
  • More generally, there are still several instances of uncapitalised 'Docker': lines 21, 23, 75, 78, 85.
  • Line 76: "docker-compose file" here should probably be "Docker Compose file".

flexibeast avatar Mar 07 '20 09:03 flexibeast

oh man I had autocorrect spell. Let me fix these. Thanks.

ghost avatar Mar 08 '20 00:03 ghost

@flexibeast

Okay, I fixed everything you pointed out. Sorry for the trouble :(

Quick question, is it virtualization or virtualisation? Void Linux Is Europe-based and I am pretty sure an s is used whereas in the United States where I am, we usually use a z. So should I put virtualisation? I know my computer marks it as misspelled with an s, and I am not going to lie, it does look a little odd to me, but I have seen civilisation in Europe and I know we spell it civilization. So I do want to double check that is how it is spelled in Europe. :) And then I will push it.

ghost avatar Mar 08 '20 03:03 ghost

Quick question, is it virtualization or virtualisation?

Well, i'm in Australia, and like many other Commonwealth nations, we tend to prefer British spellings to US spellings, so for us it's 'virtualisation' rather than 'virtualization'. That said, i don't know if there's a policy on this; a search for 'zation' in the Handbook returns no results, and a search for 'sation' in the Handbook shows 'customisation' used in config/services/configuring.md, but that was added by me. :-)

flexibeast avatar Mar 08 '20 03:03 flexibeast

Well, guess I will just go with the Commonwealth spelling for consistency. Somehow I always run into the some odd edge cases in my work ;/ Let me push it now with that change.

ghost avatar Mar 08 '20 05:03 ghost

@Frick-David do you have any podman knowledge (mentioning it here because it's related to docker)? I couldn't get it working last time I tried (on musl, though).

ericonr avatar Mar 20 '20 23:03 ericonr

@ericonr I do not, but maybe I can help. Are you getting any sort of error message?

ghost avatar Mar 23 '20 13:03 ghost

@ericonr So I ran xbps-install -S podman When I run podman I get a systemd Cgroup error, which happens for quite a bit of programs that were designed for GNU/Linux. I then ran the following commands:

# mkdir /sys/fs/cgroup/systemd
# mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd

I then ran the command:

podman run -dt -p 8080:8080/tcp -e HTTPD_VAR_RUN=/var/run/httpd -e HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \
                  -e HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \
                  -e HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \
                  registry.fedoraproject.org/f29/httpd /usr/bin/run-httpd

which is on the podman website Getting Started section. The command did succesfully run the web server.

ghost avatar Mar 23 '20 14:03 ghost

@Frick-David I did try setting up the /sys/fs/cgroup/systemd folder, and that worked (btw, what a weird folder it is).

And obviously now that I tried getting tech support it worked perfectly. I was getting some weird access issues while trying to run without root. I'm not sure what caused them, but they were a while ago, so some update might have managed to fix my issue in some indirect manner. Or perhaps enought reboots after enabling the cmanager and ConsoleKit2 services was enough.

Thanks a lot for the help, anyway!

ericonr avatar Mar 24 '20 05:03 ericonr

That is good to hear! Yeah, generally when I have an issue it tends to be either a permissions issue as well. Python 3 also seems to be really picky about that!. Any chance I can convince you to add podman documentation to the void-docs :) ? Regardless, best of luck. Podman seems pretty cool! I might start using it myself.

ghost avatar Mar 24 '20 21:03 ghost

Any chance I can convince you to add podman documentation to the void-docs :) ?

@Frick-David what do you think about making this a single page about containerization? Then Docker and Podman could be subheaders inside it. From my brief experience with podman, all it required was mounting the cgroups fs, so that step could be listed as relevant for both of them. When this gets merged I can add the additional Podman info.

ericonr avatar Apr 12 '20 19:04 ericonr

@ericonr can you confirm that the cgroups is still needed then? I installed the docker package and started the service and all was well. Can't dig into it right now myself.

bobertlo avatar Apr 12 '20 22:04 bobertlo

Yeah, neither docker nor podman are asking for any cgroups stuff any more here.

ericonr avatar Apr 13 '20 06:04 ericonr

@bobertlo So I will make the changes requested.

Was the package changed such that the cgroups section should be removed as well?

ghost avatar Apr 16 '20 01:04 ghost

@Frick-David do you have elogind enabled? If you don't, I believe your system will still require the cgroups section. Try to install and enable it to verify if the cgroups section is necessary then.

@bobertlo if it works cleanly with elogind do you think it's valid to only list that or should we list both options?

ericonr avatar Apr 17 '20 18:04 ericonr

Oh I do have elogind running that could be it. New to running it so I didn't consider that.

bobertlo avatar Apr 17 '20 21:04 bobertlo

I don't really use docker, but I know that there should be a note about the docker group that its equivalent to becoming root. See the warning in archs wiki.

Duncaen avatar May 17 '20 10:05 Duncaen

So I reread the documentation and one of the beginning pages says this wiki is for configuring the system only. So docker, nor my other commit, steam are necessary. However, I have seen people talk about a miscellaneous section. Can I have some direction on this as I do feel adding these pages to the 'core' documentation seems iffy. It is a different format than the wiki.

ghost avatar Jun 09 '20 16:06 ghost

@ericonr It should be good on the cgroups like you said.

ghost avatar Jun 09 '20 16:06 ghost

@ericonr: Reviewing this PR again, i'm not sure of the extent to which it needs to be a separate page. From what i can tell, the critical parts are:

  • You need to be a member of the docker group to use it; the docker group is equivalent to becoming root.
  • If you're not using elogind, you need to do cgroups stuff.

In this comment, you suggested that we instead have a "Containerization" section, in which this information could be included. If you still think that's the way to go, i'm fine with that.

flexibeast avatar Jun 15 '20 02:06 flexibeast

@flexibeast, what are your thoughts on this now? Should we put docker into the external applications page?

ghost avatar Jun 22 '20 21:06 ghost

@Frick-David: i'm thinking that maybe we could have a "Containers and VMs" section, which would mention not only Docker, but also e.g. Podman, QEMU and libvirt. i'm going to check with more senior members of the Void team if they have any objections to such a section being included.

flexibeast avatar Jun 23 '20 03:06 flexibeast

@Frick-David: After asking on IRC, there don't seem to be any immediate objections to such a section, so i've just opened #350, so that Void team members not currently around on IRC can comment if necessary.

flexibeast avatar Jun 23 '20 03:06 flexibeast