Terminal / CLI

Docker


docker build -f [filkällan för din dockerfil] -t .
Skapar en docker-image från din Dockerfile
docker login
Loggar in mot din Docker Hub så att du kan
ex docker pull gaddracademy/myapps

docker run [image]
docker run -p 8080:80 [image]
Kör en docker-container på en specifik port. I detta fallet s¨tar den containerns 80-port och 8080-porten ex docker run -p
docker stop [container-namnet]
Stannar docker-containern


_________________________________________________________________________________________________________________
Extra info:
Docker Build:
Table 1
0
--add-host
Column 2
Add a custom host-to-IP mapping (host:ip)
1
--build-arg
Set build-time variables
2
--cache-from
Images to consider as cache sources
3
--cgroup-parent
Optional parent cgroup for the container
4
--compress
Compress the build context using gzip
5
--cpu-period
Limit the CPU CFS (Completely Fair Scheduler) period
6
--cpu-quota
Limit the CPU CFS (Completely Fair Scheduler) quota
7
--cpu-shares , -c
CPU shares (relative weight)
8
--cpuset-cpus
CPUs in which to allow execution (0-3, 0,1)
9
--cpuset-mems
MEMs in which to allow execution (0-3, 0,1)
10
--disable-content-trust
true
Skip image verification
11
--file , -f
Name of the Dockerfile (Default is 'PATH/Dockerfile')
12
--force-rm
Always remove intermediate containers
13
--iidfile
Write the image ID to the file
14
--isolation
Container isolation technology
15
--label
Set metadata for an image
16
--memory , -m
Memory limit
17
--memory-swap
Swap limit equal to memory plus swap: '-1' to enable unlimited swap
18
--network
API 1.25+
Set the networking mode for the RUN instructions during build
19
--no-cache
Do not use cache when building the image
20
--output , -o
API 1.40+
Output destination (format: type=local,dest=path)
21
--platform
API 1.38+
Set platform if server is multi-platform capable
22
--progress
auto
Set type of progress output (auto, plain, tty). Use plain to show container output
23
--pull
Always attempt to pull a newer version of the image
24
--quiet , -q
Suppress the build output and print image ID on success
25
--rm
true
Remove intermediate containers after a successful build
26
--secret
API 1.39+
Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret
27
--security-opt
Security options
28
--shm-size
Size of /dev/shm
29
--squash
experimental (daemon)API 1.25+
Squash newly built layers into a single new layer
30
--ssh
API 1.39+
SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|<id>[=<socket>|<key>[,<key>]])
31
--stream
Stream attaches to server to negotiate build context
32
--tag , -t
Name and optionally a tag in the 'name:tag' format
33
--target
Set the target build stage to build.
34
--ulimit
Ulimit options
There are no rows in this table
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.