Skip to main content

General Docker Information

====================================================================================

To preface this page; I personally recommend trying out Portainer, which is essentially a web GUI for Docker - it's great. Portainer even lives in a docker container itself.

====================================================================================

Installation

Install Docker CE (Community Edition)

apt install docker.io

====================================================================================

Commands & Usage

------------------------------------------------------------------------------------------------------------------------------------------------

Managing Containers

List Docker processes/containers (running and stopped)
docker ps -a
Start a container
docker start containername
stop a container
docker stop containername
Delete a container
docker rm containername
Check container performance metrics
docker stats containername

------------------------------------------------------------------------------------------------------------------------------------------------

Adding new docker images

Docker has their own 'marketplace' of sorts for docker images:

https://hub.docker.com/ 

To install a new docker image
docker pull container-name
List installed Docker images
docker images
Search locally installed images, and search Docker repository for available images
docker search name

------------------------------------------------------------------------------------------------------------------------------------------------

Launching Containers

====================================================================================

Basic launch for a container based on an image

docker run --name containername -it imagename

There are lots and lots of options available for the docker run command:

Starting an instance with this method will push your shell into the container itself. To exit the container (continues running):

ctrl+p ctrl+x

To connect to a docker image:

docker attach containername

====================================================================================

====================================================================================