-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add first Docker image recipe #734
Conversation
.github/docker/README.md
Outdated
To build docker image on local machine execute: | ||
|
||
```sh | ||
docker build --build-arg https_proxy=http://proxy.com:port --build-arg http_proxy=http://proxy.com:port -t ur:ubuntu-22.04 -f ./ubuntu-22.04.Dockerfile . |
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 feel like the http_proxy
/https_proxy
arguments should be optional and opt-in if the user is required to use a proxy network.
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.
This is just a readme file with example commands - many of these parameters are optional (even image tagging) 😉 I believe many of us, who use this instruction, are located behind corporate proxy servers. Nonetheless, I rephrased it to be optional.
# Add and switch to a new (non-root) 'user' | ||
ENV USER user | ||
ENV USERPASS pass | ||
RUN useradd -m $USER -g sudo -p `mkpasswd $USERPASS` | ||
USER $USER |
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 personally use podman
instead of docker
which when used in rootless mode matches the uid/gid of the containers root user to that of the current host user which is nice when mounting volumes in the host user home directory as any modified files have the correct owner. This is obviously not how docker
works, since all containers are run as the host root user.
Having the container image setup a user breaks the ease of use of podman
running in rootless mode. Would it be possible to make user creation optional somehow?
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.
Another approach I've seen with docker
is to explicitly map the containers root user to the current host users uid/gid by passing --user $UID:$GID
to docker run
.
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.
It seems like a nice thing, but... I can't make it work locally (using docker
). I guess it's time to switch to podman 😉
Anyway, I removed the USER
command, since we can switch to user
in CI, using your proposed --user
param.
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.
It seems like a nice thing, but... I can't make it work locally (using docker).
That's a shame.
Anyway, I removed the USER command, since we can switch to user in CI, using your proposed --user param.
Just tried out the Dockerfile with podman
and its working nicely now. Thanks :)
8403543
to
a908e17
Compare
This image can be used in CI or as a development container.
a908e17
to
d8922f8
Compare
This image can be used in CI or as a development container.
// tested locally, it works like a charm.