Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Dockerfile commands to implement #1

@priyawadhwa

Description

@priyawadhwa

FROM

  • Add support for ARG with FROM

RUN

  • Run command in shell form -- RUN , default prefixed by "sh -c"
  • Run command in exec form
  • Change default shell for RUN command with the SHELL command

CMD

  • CMD in exec form
  • CMD as default parameters to entrypoint
  • CMD in shell form, default prefixed by "sh -c"
  • If multiple CMD calls in Dockerfile, only the last should be run

LABEL

  • Adds metadata to image (labels are inherited by parent/base images)

EXPOSE

  • Expose a port

ENV

  • Set environment variables as <key>:<value> pairs in image

ADD
Add has two forms:

  • ADD [--chown=<user>:<group>] <src>... <dest>

  • ADD [--chown=<user>:<group>] ["<src>",... "<dest>"]

  • Copy new files, directories, or remote URLs from <src> to the <dest>

  • Multiple sources may be specified, their paths are interpreted as relative to the context of the build

  • Support for any <src> to contain wildcards

  • <dest> is absolute path, or relative to WORKDIR command

  • Specify UID/GID with --chown flag

  • If <src> is local tar archive, it is unpacked to destination directory

COPY
COPY has two forms:
-COPY [--chown=<user>:<group>] <src>... <dest>
-COPY [--chown=<user>:<group>] ["<src>",... "<dest>"]

  • Allow copy from multiple sources to destination
  • Add support for wildcards in <src>
  • Specify UID/GID with --chown flag
  • Set source location to previous build stage with --from flag

ENTRYPOINT

  • Set entrypoint in exec and shell form

VOLUME

  • Create a mount point and mark it as holding externally mounted volumes

USER

  • Set UID/GID

WORKDIR

  • Set working directory

ARG

  • Implement ARG

ONBUILD

  • Add trigger to metadata of the image, under the key OnBuild

STOPSIGNAL

  • Implement stopsignal

HEALTHCHECK

  • Implement healthcheck

SHELL

  • Override default shell, can effect RUN/CMD/ENTRYPOINT commands

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions