added dockerfile and docker-compose cheat sheet entries
This commit is contained in:
parent
c4970b3875
commit
acc1814034
3
blog/src/docker/docker-compose.md
Normal file
3
blog/src/docker/docker-compose.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Dockerfile Cheat Sheet
|
||||
|
||||
Coming soon...
|
85
blog/src/docker/dockerfile.md
Normal file
85
blog/src/docker/dockerfile.md
Normal file
@ -0,0 +1,85 @@
|
||||
# Dockerfile Cheat Sheet
|
||||
|
||||
## Starting Point
|
||||
|
||||
Arguments that dictate what to use as a starting point for the dockerfile
|
||||
|
||||
### FROM
|
||||
|
||||
Specifies what image to use as a base
|
||||
|
||||
Usage:
|
||||
```
|
||||
FROM <image>
|
||||
FROM <image>:<tag>
|
||||
FROM <image>@<digest>
|
||||
```
|
||||
Notes:
|
||||
- **From is a required argument, and must come first**
|
||||
- If no tag is specified, the "latest" tag will be used
|
||||
|
||||
|
||||
## Metadata
|
||||
|
||||
Arguments that don't affect how the image builds or container runs, but give information about the image
|
||||
|
||||
### MAINTAINER
|
||||
|
||||
Allows you to specify an author
|
||||
|
||||
Usage:
|
||||
```
|
||||
MAINTAINER <name>
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
### ENV
|
||||
|
||||
|
||||
### ADD
|
||||
|
||||
|
||||
### WORKDIR
|
||||
|
||||
### SHELL
|
||||
|
||||
Command to change the shell that RUN uses
|
||||
|
||||
Usage:
|
||||
```
|
||||
SHELL ["<cmd>", "<arg1>", "<arg2>", ...]
|
||||
```
|
||||
Notes:
|
||||
- Only changes shell for following RUN commands, you can switch between shells if you so desire
|
||||
|
||||
|
||||
## Build
|
||||
|
||||
### RUN
|
||||
|
||||
Command to run in order to build the image
|
||||
|
||||
Usage:
|
||||
```
|
||||
RUN <cmd>
|
||||
RUN ["<cmd>", "<arg1>", "<arg2>", ...]
|
||||
```
|
||||
|
||||
Notes:
|
||||
- The build will fail if a run command returns a non-zero code
|
||||
- Runs with the "default shell" (can be changed with the SHELL command)
|
||||
|
||||
|
||||
|
||||
### CMD
|
||||
|
||||
|
||||
###
|
||||
|
||||
## Running
|
||||
|
||||
### EXPOSE
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user