Difference between revisions of "Dockerfile"

From wikieduonline
Jump to navigation Jump to search
 
(16 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
For creating this file with instructions usually called Dockerfile you can use the following keywords<ref>https://kapeli.com/cheat_sheets/Dockerfile.docset/Contents/Resources/Documents/index</ref>:
 
For creating this file with instructions usually called Dockerfile you can use the following keywords<ref>https://kapeli.com/cheat_sheets/Dockerfile.docset/Contents/Resources/Documents/index</ref>:
 
* <code>[[ADD]]</code>
 
* <code>[[ADD]]</code>
* ARG
+
* <code>[[ARG]]</code>
* [[CMD]], for executing containers. https://docs.docker.com/engine/reference/builder/#cmd
+
* <code>[[CMD]]</code> for executing containers. https://docs.docker.com/engine/reference/builder/#cmd
* COPY
+
* <code>[[COPY]]</code>
* [[ENTRYPOINT]]: https://docs.docker.com/engine/reference/builder/#entrypoint
+
* <code>[[ENTRYPOINT]]</code>: https://docs.docker.com/engine/reference/builder/#entrypoint
* [[ENV]]
+
* <code>[[ENV]]</code>
* [[EXPOSE]]
+
* <code>[[EXPOSE]]</code>
 
* <code>[[FROM]]</code> https://docs.docker.com/engine/reference/builder/#from                                     
 
* <code>[[FROM]]</code> https://docs.docker.com/engine/reference/builder/#from                                     
 
* [[HEALTHCHECK]] https://docs.docker.com/engine/reference/builder/#healthcheck (>= [[Docker 1.12]])
 
* [[HEALTHCHECK]] https://docs.docker.com/engine/reference/builder/#healthcheck (>= [[Docker 1.12]])
Line 16: Line 16:
 
* SHELL
 
* SHELL
 
* STOPSIGNAL
 
* STOPSIGNAL
* <code>[[USER]]</code>
+
* <code>[[USER]]</code>:</code> https://docs.docker.com/engine/reference/builder/#user
 
* [[VOLUME]],  creates a [[mount point]]
 
* [[VOLUME]],  creates a [[mount point]]
 
* WORKDIR
 
* WORKDIR
Line 28: Line 28:
  
 
== Related terms ==
 
== Related terms ==
 +
* [[Dockerfile examples]]
 
* <code>[[docker build]]</code>
 
* <code>[[docker build]]</code>
 +
* <code>[[docker-compose build]]</code>, <code>[[image]]:, [[build:]], [[dockerfile:]], [[args:]]</code>
 
* [[Docker Engine release notes]]
 
* [[Docker Engine release notes]]
 
* [[BuildKit]]  Dockerfile-agnostic builder toolkit
 
* [[BuildKit]]  Dockerfile-agnostic builder toolkit
* <code>[[docker start]]</code>
+
* <code>[[docker start]]</code>, <code>[[docker run]]</code>
* <code>[[docker run]]</code>
 
* [[Dockerfile examples]]
 
 
* [[Buildpack]]
 
* [[Buildpack]]
 
* <code>[[.dockerignore]]</code>
 
* <code>[[.dockerignore]]</code>
 
* <code>[[Makefile]]</code>
 
* <code>[[Makefile]]</code>
 +
* [[Caddyfile]]
  
 
== See also ==
 
== See also ==

Latest revision as of 17:41, 22 February 2024

Dockerfile is a text file where you define instructions used to create your Docker images, check official Dockerfile Reference documentation: https://docs.docker.com/engine/reference/builder/[1]

For creating this file with instructions usually called Dockerfile you can use the following keywords[2]:

Activities[edit]

  1. Learn differences between RUN and CMD or ENTRYPOINT: https://stackoverflow.com/a/25150809
  2. Read Understand how CMD and ENTRYPOINT interact https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact
  3. Learn about start configuration behavior and restart policy
  4. Learn how to use .dockerignore file
  5. Read Dockerfile best practices https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

Related terms[edit]

See also[edit]

  • https://en.wikiversity.org/wiki/DevOps/Docker/Dockerfile
  • https://kapeli.com/cheat_sheets/Dockerfile.docset/Contents/Resources/Documents/index
  • Advertising: