Skip to content

Commit de910ed

Browse files
unknownunknown
unknown
authored and
unknown
committed
added docker module
1 parent 8809057 commit de910ed

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

docker/Dockerfile_Instructions.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@ DockerFile
2929

3030
2. Docker distributes official versions of the images that can be used for building Dockerfiles under docker/dockerfile repository on Docker Hub.
3131

32-
3332
- `FROM` - A valid Dockerfile must start with a FROM instruction.
3433

3534
- `RUN` - The RUN instruction will execute any commands in a new layer on top of the current image and commit the results. The resulting committed image will be used for the next step in the Dockerfile.
3635

3736
- `CMD` - The main purpose of a CMD is to provide defaults for an executing container.
3837

39-
`Note:` There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect.
38+
`Note:` There can only be one CMD instruction in a Dockerfile. If you list more than one CMD then only the last CMD will take effect.
4039

41-
`Note` - Do not confuse RUN with CMD. RUN actually runs a command and commits the result; CMD does not execute anything at build time, but specifies the intended command for the image.
40+
`Note` - Do not confuse RUN with CMD. RUN actually runs a command and commits the result; CMD does not execute anything at build time, but specifies the intended command for the image.
4241

4342
- `LABEL` -The LABEL instruction adds metadata to an image. A LABEL is a key-value pair. T
4443

@@ -51,25 +50,22 @@ DockerFile
5150

5251
- `ADD` - The ADD instruction copies new files, directories or remote file URLs from <src> and adds them to the filesystem of the image at the path <dest>.
5352

54-
If <src> is a local tar archive in a recognized compression format (identity, gzip, bzip2 or xz) then it is unpacked as a directory.
53+
If <src> is a local tar archive in a recognized compression format (identity, gzip, bzip2 or xz) then it is unpacked as a directory.
5554

5655
- `COPY` - The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>.
5756

5857
- `ENTRYPOINT` - An ENTRYPOINT allows you to configure a container that will run as an executable.
5958

60-
ENTRYPOINT will override all elements specified using CMD
61-
62-
### Understand how CMD and ENTRYPOINT interact
63-
64-
Both CMD and ENTRYPOINT instructions define what command gets executed when running a container. There are few rules that describe their co-operation.
59+
1. ENTRYPOINT will override all elements specified using CMD
60+
2. Both CMD and ENTRYPOINT instructions define what command gets executed when running a container. There are few rules that describe their co-operation.
6561

66-
Dockerfile should specify at least one of CMD or ENTRYPOINT commands.
62+
3. Dockerfile should specify at least one of CMD or ENTRYPOINT commands.
6763

68-
- `ENTRYPOINT` - should be defined when using the container as an executable.
64+
4. ENTRYPOINT should be defined when using the container as an executable.
6965

70-
CMD should be used as a way of defining default arguments for an ENTRYPOINT command or for executing an ad-hoc command in a container.
66+
5. CMD should be used as a way of defining default arguments for an ENTRYPOINT command or for executing an ad-hoc command in a container.
7167

72-
CMD will be overridden when running the container with alternative arguments.
68+
6. CMD will be overridden when running the container with alternative arguments.
7369

7470
- `VOLUME` - The VOLUME instruction creates a mount point with the specified name and marks it as holding externally mounted volumes from native host or other containers.
7571

0 commit comments

Comments
 (0)