-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development: docker (and podman) #356
base: master
Are you sure you want to change the base?
Conversation
(duplicate with branch `variograms`)
Site tested and ready for review. Thank you in advance! |
While reviewing #356, the instructions of the PR template for reviewing seem to no longer work to render the site from the GHA artifact. With these changes, it seems to work again though, using python -m http.server 8887
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this guided tour! We can discuss some things live further. Some of my comments are an example and apply to more places.
Some questions.
Images are stored in different places between Docker and Podman:
$ podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/library/alpine latest b0c9d60fc5e3 4 weeks ago 8.13 MB
$
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
test-mne latest b711361627aa 2 days ago 5.47GB
nginx latest 97662d24417b 4 days ago 192MB
rocker/tidyverse latest 0a2c0d551856 3 weeks ago 2.73GB
alpine latest a606584aa9aa 7 months ago 7.8MB
geopython/geopython-workshop latest ed98940df343 20 months ago 1.05GB
ubuntu latest 99284ca6cea0 20 months ago 77.8MB
hello-world latest d2c94e258dcb 21 months ago 13.3kB
Is it possible to let Podman run a container I installed or built with Docker in this setting?
Also, I'm hesitant to log into RStudio Server as root (Podman case): how should we look at this? What are the permissions of the rstudio
user (Docker case)?
title: "Development/Docker: Compose" | ||
format: | ||
html: | ||
toc: true | ||
html-math-method: katex | ||
code-fold: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The qmd file does not seem to be on par with index.md
? I don't see md_document
as an output format here (cf other tutorials). If you are editing the index.md
file directly, then you can drop the qmd file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a qmd
is still experimental; I much prefer the format, but it does not fully match the tutorial workflow. Currently, I quarto render --to hugo-md
and apply the conversion steps found in notes_qmd.txt
.
The yaml header, specifically, does not translate well despite preserve_yaml: true
. I synced them now, but it is crucial to always review it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the figures are not in a subdirectory of the tutorial directory? (Cf other tutorials)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
On all the other tutorials I saw, the images are generated by running the Rmd main file.
It makes nostalgic sense to keep them with the tutorial, but in fact they are subject to version control and change upon every re-render.
The images for this tutorial are screenshots, i.e. static images. In a hugo
context, these are best stored in the static
folder.
Both is possible. I would follow the opinion of the website maintainers (@damianooldoni ?)
|
||
The downside of this is that your container is isolated (well... at least to a certain degree). | ||
|
||
To store files locally, i.e. on the host machine, without storing the bloated container, you will have to map a virtual path on the container to a local drive on your computer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without storing the bloated container
The technique is equally relevant when running the container locally (hence storing it), hence not limited to remote hosts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good addition, thank you (I added it to the text).
|
||
The downside of this is that your container is isolated (well... at least to a certain degree). | ||
|
||
To store files locally, i.e. on the host machine, without storing the bloated container, you will have to map a virtual path on the container to a local drive on your computer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use (subtly) offensive or provocative language in tutorials. It's not a personal blog 😉, it's an organisation's website, so as an author you also give a face to the organisation. You can point at disadvantages, but do it neutrally, short and don't involve the personal rants. Rather focus on the positive and supportive vibes for things you do want to teach.
Example (a more subtle one):
To store files locally, i.e. on the host machine, without storing the bloated container, you will have to map a virtual path on the container to a local drive on your computer. | |
To store files locally, i.e. on the host machine, without storing the container, you will have to map a virtual path on the container to a local drive on your computer. |
And in another sentence (or place) you could add e.g. 'Images can take up considerable storage space. You better take control of this by ...'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed; my apologies. In part the reason is that I started this as personal notes. Nevertheless I should have re-read with the organization's perspective in mind.
Still, I am a bit confused.
I removed the "rants" elsewhere, and will re-read carefully again tomorrow.
However, on the "suggested change" line, I do not understand why you suggest a change.
You removed "bloated", but in the IT context (see here, "business english"/"IT"), this is quite common and I find it useful.
I much appreciate if you point out the exact words you suggest to change, I don't take change suggestions personally, so the more, the better. ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your response. As I encounter the word in IT context, 'bloated' is mostly used in a blaming sense, so that is how it appears to me here; an INBO tutorial should not usually do that. But it will be easier to discuss that live.
At https://en.wikipedia.org/wiki/Software_bloat I find:
The term is not applied consistently; it is often used as a pejorative by end users, including to describe undesired user interface changes even if those changes had little or no effect on the hardware requirements
The downside of this is that your container is isolated (well... at least to a certain degree). | ||
|
||
To store files locally, i.e. on the host machine, without storing the bloated container, you will have to map a virtual path on the container to a local drive on your computer. | ||
(Linux people will be familiar with the concept of "mounting" and "linking" storage locations.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe 'users' is more appropriate than 'Linux people' or 'Windows people'; the latter seem to label individuals which we should not do.
(Linux people will be familiar with the concept of "mounting" and "linking" storage locations.) | |
(Linux users will be familiar with the concept of "mounting" and "linking" storage locations.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed and adjusted.
Whales don't really carry "containers", and "images" are better hung on walls. | ||
Don't fall for the docker marketing! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't post that here please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I have removed it.
But I honestly don't know why this might be considered inappropriate.
Whales really do not carry containers.
The intermezzo comment was meant as a general invitation to keep users thinking about what they read and see.
And personally, I find it dull to read texts and books which never break the flow to make you hesitate to re-think what you know.
Again, no problem, this is personal taste versus organizational exposition, and I am very glad for your critical reading!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for removing it.
Yes, of course whales don't carry containers, but the reader tries to grasp why you say that. Since this humour seems to revolve around blaming (the second line!), I didn't consider it appropriate. Especially when you consider disadvantages of a technology, I recommend to stick to that (keep it technical and neutral) instead of blaming developers or organisations. We don't offend.
{{% /callout %}} | ||
|
||
``` sh | ||
sudo apt update && sudo apt install docker docker-buildx # debian-based |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the same as this (which I followed):
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
$ dpkg -l | grep docker
ii docker-buildx-plugin 0.20.0-1~ubuntu.22.04~jammy amd64 Docker Buildx cli plugin.
ii docker-ce 5:27.5.1-1~ubuntu.22.04~jammy amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:27.5.1-1~ubuntu.22.04~jammy amd64 Docker CLI: the open-source application container engine
ii docker-ce-rootless-extras 5:27.5.1-1~ubuntu.22.04~jammy amd64 Rootless support for Docker.
ii docker-compose-plugin 2.32.4-1~ubuntu.22.04~jammy amd64 Docker Compose (V2) plugin for the Docker CLI.
``` sh | ||
systemctl start docker | ||
|
||
systemctl status docker # check status | ||
|
||
systemctl stop docker.socket | ||
systemctl stop docker.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! Starting processes on system boot is not the best idea; people loose track easily, I tend to not do that.
Autostart is optional. I will look up what containerd
does, did not even notice it got installed.
docker run --rm -p 8787:8787 -e PASSWORD=YOURNEWPASSWORD rocker/rstudio | ||
``` | ||
|
||
- The `--rm` flag makes the docker image non-permanent, i.e. disk space will be freed after you close the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One can also manage this post-hoc, using docker rmi
(or docker system prune
to do a large cleanup). This prevents re-downloading images afterwards if you need the container again. I would not use --rm
by default, unless the aim is really to give it a single shot and then quit.
The last one, `passt` (providing `pasta`, yum!), is required for rootless network access. | ||
Optionally, there is `podman-compose`. | ||
|
||
Out of the box, Podman will run *only if you are root*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requirements below seem to be met out of the box in an Ubuntu environment. Then am I right that the 'out of the box' statement here does not hold?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the extra observation; I will make the text "box-independent".
Thank you for the thorough review! I will go through your comments and adjust.
I have not looked this up, but the chance is low. Pods work technically different from docker containers, and once you build or pull one, it is converted into a container of the respective system.
so you can transfer the recipe's, not the outcome.
The difference, as I understand it, is that a container with the unprivileged container user in the Docker case still requires privileged execution on the host system. To me, this brings the risk of privilege escalation in case of breakout to the root. I will double-check and try. |
Description
This tutorial summarizes initial steps in creating docker images.
Matter of fact, it is just an assembly of components and tutorials which I found helpful for applying docker in an INBO-environment.
Task list
tutorials/content
index.md
. In case of an Rmarkdown tutorial I have knitted myindex.Rmd
toindex.md
(both files are pushed to the repo).tags
in the YAML header (see the tags listed in the tutorials website side bar for tags that have been used before)categories
to the YAML header and my category tags are from the list of category tagsstatic
folder.