Fabrice Geib

Docker

Author

fabricegeib

Date Published

Install docker

1# Add Docker's official GPG key:
2sudo apt update
3sudo apt install ca-certificates curl
4sudo install -m 0755 -d /etc/apt/keyrings
5sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
6sudo chmod a+r /etc/apt/keyrings/docker.asc
7
8# Add the repository to Apt sources:
9sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
10Types: deb
11URIs: https://download.docker.com/linux/debian
12Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
13Components: stable
14Architectures: $(dpkg --print-architecture)
15Signed-By: /etc/apt/keyrings/docker.asc
16EOF
17
18sudo apt update

Set up Docker's apt repository


1sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
2
3sudo systemctl status docker
4
5sudo systemctl start docker
6
7sudo docker run hello-world
8
9sudo systemctl stop docker

Install the Docker packages and status


1# build with simple tag
2docker build -t fabricegeib:1.0.0 .
3
4# build with specific Dockerfile
5docker build -f Dockerfile.prod -t fabricegeib:prod .
6
7# build + tag
8docker build -t ghcr.io/fabricegeib/fabricegeib:1.0.0 .
9
10# rename or give another tag
11docker tag fabricegeib:1.0.0 registry.fabricegeib.com/fabricegeib:1.0.0
12
13# push to your registry
14docker push registry.fabricegeib.com/fabricegeib:1.0.0
15
16# start the image
17docker run -p 3000:3000 fabricegeib/fabricegeib:1.0.0

create image and push to registry