docker:
  VOLUME:
  - <volume>
  EXPOSE:
  - <expose>
  ENV:
    <env_name>: <env_value>
  LABEL:
    <label_name>: <label_value>
  ENTRYPOINT: <entrypoint>
  CMD: <cmd>
  WORKDIR: <workdir>
  USER: <user>
  HEALTHCHECK: <healthcheck>
The
dockerdirective is deprecated and will be removed in v3. Please use theimageSpecdirective instead. Read more about theimageSpecdirective here.
Dockerfile instructions can be divided into two groups: build-time instructions and other instructions affecting an image manifest. Build-time instructions do not make sense in a werf build process. Thus, werf supports only following instructions:
USERto set the user name (or UID) and optionally the user group (or GID) (read more here).WORKDIRto set the working directory (read more here).VOLUMEto add a mount point (read more here).ENVto set the environment variable (read more here).LABELto add metadata to an image (read more here).EXPOSEto inform Docker that the container listens on the specified network ports at runtime (read more here)ENTRYPOINTto configure a container that will run as an executable (read more here). How the Stapel builder processes CMD and ENTRYPOINT is covered here.CMDto provide the default arguments for theENTRYPOINTto configure a container that will run as an executable (read more here). How the Stapel builder processes CMD and ENTRYPOINT is covered here.HEALTHCHECKto tell Docker how to test a container to see if it is still working (read more here)
These instructions can be specified in the docker config directive.
Here is an example of using Docker instructions:
docker:
  WORKDIR: /app
  CMD: ["python", "./index.py"]
  EXPOSE: '5000'
  ENV:
    TERM: xterm
    LC_ALL: en_US.UTF-8
The Docker instructions defined in the configuration are applied during the last stage called docker_instructions.
Thus, instructions do not affect other stages but are applied to a built image.
If you need to use specific environment variables at build time (such as a TERM environment), you have to use the base image in which these environment variables are set.
Tip: you can also export environment variables right to the user stage instructions.