Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dockerfiles [2019/12/29 11:27] – [Notes] rpjdaydockerfiles [2020/01/03 11:58] (current) – [Q] rpjday
Line 18: Line 18:
 ===== Q ===== ===== Q =====
  
 +  * Applicability of Containerfile? Also ".in" suffix for podman?
 +  * COPY versus ADD?
   * Does every new FROM directive start a new "build stage"?   * Does every new FROM directive start a new "build stage"?
   * What is the scope of an ENV versus ARG directive?   * What is the scope of an ENV versus ARG directive?
   * Can a context be a local tarball? Others?   * Can a context be a local tarball? Others?
   * How to use ''%%--%%cache-from''?   * How to use ''%%--%%cache-from''?
 +  * relevance of ''.dockerignore'' with ''podman''/''buildah''?
 +  * Can we display context?
  
 ===== Usage ===== ===== Usage =====
 +
 +Needs:
 +
 +  * Dockerfile/Containerfile
 +  * context
  
 <code> <code>
Line 45: Line 54:
   * syntax (BuildKit only)   * syntax (BuildKit only)
  
-==== .dockerignore ====+==== .dockerignore (in root dir of context) ====
  
-You can safely exclude ''Dockerfile'' and ''.dockerignore''; they're sent, anyway.+  * You can safely exclude ''Dockerfile'' and ''.dockerignore''; they're sent, anyway. 
 +  * Uses Go's filepath.Match rules 
 +  * Also ''**/*.go'', and exceptions using ''!'' 
 +  * last match takes precedence
  
 ===== Dockerfile directives ===== ===== Dockerfile directives =====
Line 58: Line 70:
 ==== FROM ==== ==== FROM ====
  
-  * Dockerfile must start with a ''FROM'' instruction+  * Dockerfile must start with a ''FROM'' instruction (after possible ''ARG'' directives)
   * sets a //base image//, initializes a new //build stage//   * sets a //base image//, initializes a new //build stage//
   * can occur multiple times in a Dockerfile, perhaps to make one build stage dependent on another   * can occur multiple times in a Dockerfile, perhaps to make one build stage dependent on another
Line 98: Line 110:
 </code> </code>
  
-==== COPY ====+==== COPY (preferred unless you need ADD extensions) ====
  
   * ''.dockerignore'' file, see [[https://docs.docker.com/engine/reference/builder/#dockerignore-file|here]]   * ''.dockerignore'' file, see [[https://docs.docker.com/engine/reference/builder/#dockerignore-file|here]]
Line 133: Line 145:
   * TCP if protocol is not specified   * TCP if protocol is not specified
   * use ''docker run -p/-P'' to actually expose ports   * use ''docker run -p/-P'' to actually expose ports
 +
 +==== HEALTHCHECK ====
  • dockerfiles.1577618856.txt.gz
  • Last modified: 2019/12/29 11:27
  • by rpjday