added dockerfile and docker-compose cheat sheet entries

This commit is contained in:
Michael Scalzetti 2023-01-08 16:30:54 -05:00
parent c4970b3875
commit acc1814034
2 changed files with 88 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# Dockerfile Cheat Sheet
Coming soon...

View 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