Difference between revisions of "Containerfile"

From John Freier
Jump to: navigation, search
 
Line 6: Line 6:
 
This set the working directory, it will also create the directory if it doesn't exists.
 
This set the working directory, it will also create the directory if it doesn't exists.
 
   WORKDIR /opt
 
   WORKDIR /opt
 +
 +
== COPY ==
 +
This will copy a file from the local host to the container.
 +
  COPY app.tar /app
 +
 +
* user ADD if you want to have more options, like auto extract and git pulls.
  
 
== ENV ==
 
== ENV ==

Latest revision as of 12:59, 17 January 2023

Containerfile and Dockerfile are interchangeable for the most part.

OCI prefers the generic term Containerfile.

WORKDIR

This set the working directory, it will also create the directory if it doesn't exists.

 WORKDIR /opt

COPY

This will copy a file from the local host to the container.

 COPY app.tar /app
  • user ADD if you want to have more options, like auto extract and git pulls.

ENV

To set an environment variable.

 ENV EXAMPLE=/opt/example
 ENV APP_PROFILE=dev