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

Containerfile: mention --user 1001 on custom images #1842

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ You need to install Podman or the Docker runtime (Docker Desktop on macOS or Win

Your project must have a Containerfile or Dockerfile to use dev mode in container mode. An example of container configuration is shown in [Building an application image](https://github.com/openliberty/ci.docker/#building-an-application-image). The parent image must be one of the [Open Liberty container images](https://github.com/openliberty/ci.docker/#container-images), or an image using Linux with Open Liberty configured with the same paths as the Open Liberty container images. The container config file must copy the application .war file and the server configuration files that the application requires into the container.

In case you are using a custom image, you need to add `--user 1001` (or whatever user id the image should run with) to your `containerRunOpts` configuration variable. You can also set it on the command line using `"-DcontainerRunOpts=--user 1001"`.

Dev mode works with a temporary, modified copy of your container config file to allow for hot deployment during development as detailed below. When dev mode starts up, it pulls the latest version of the parent image defined in the container config file, builds the container image, then runs the container. Note that the context of the container's `build` command used to generate the container image is the directory containing the container config file, unless the `containerBuildContext` parameter is specified. When dev mode exits, the container is stopped and deleted, and the logs are preserved in the directory mentioned above.

Hot deployment is made possible because the application is installed as a loose application WAR. This method uses a file type of `.war.xml` which is functionally equivalent to the `.war` file. Dev mode only supports the application under development in the current project so to avoid application conflicts, dev mode removes all commands that copy or add a `.war` file from the container config file.
Expand Down
Loading