Skip to content

Commit

Permalink
Containerfile: mention --user 1001 on custom images
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarwell authored Oct 24, 2024
1 parent 7685b4c commit d45e018
Showing 1 changed file with 2 additions and 0 deletions.
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 cal 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

0 comments on commit d45e018

Please sign in to comment.