Skip to content
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

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

lukaszstolarczuk
Copy link
Contributor

This image can be used in CI or as a development container.

// tested locally, it works like a charm.

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 .
Copy link
Contributor

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.

Copy link
Contributor Author

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.

.github/docker/README.md Outdated Show resolved Hide resolved
Comment on lines 67 to 71
# 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
Copy link
Contributor

@kbenzie kbenzie Jul 20, 2023

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 :)

.github/docker/README.md Outdated Show resolved Hide resolved
This image can be used in CI or as a development container.
@pbalcer pbalcer merged commit 333cfc2 into oneapi-src:main Jul 28, 2023
24 checks passed
@lukaszstolarczuk lukaszstolarczuk deleted the add-docker-image branch August 2, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants