Docker cheat sheet

Check Version

Containers

Lifecycle

Starting and Stopping

CPU Constraints

You can limit CPU, either using a percentage of all CPUs, or by using specific cores.

For example, you can tell the cpu-sharesarrow-up-right setting. The setting is a bit strange -- 1024 means 100% of the CPU, so if you want the container to take 50% of all CPU cores, you should specify 512:

You can also only use some CPU cores using cpuset-cpusarrow-up-right:

Note that Docker can still see all of the CPUs inside the container -- it just isn't using all of them.

Memory Constraints

You can also set memory constraintsarrow-up-right on Docker:

Info

Import / Export

Import/Export container

Import a container as an image from file:

Export an existing container:

Executing Commands

Images

Lifecycle

Info

Load/Save image

Load an image from file:

Save an existing image:

Dockerfile

Instructions

Registry & Repository

Volumes

Lifecycle

Info

Networks

Lifecycle

Info

Connection

.

.

.

------

https://github.com/wsargent/docker-cheat-sheet#dockerfilearrow-up-right

Last updated