Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Add the repository to Apt sources:
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
goto docker hub to find the official docker image and pull it
docker pull image_name
create app network
docker network create app_name_network
# docker run \
# --name jenkins-docker \ # create container name
# --restart=unless-stopped \ # restart container
# --detach \ # run container in background
# --privileged \ # run container in privileged mode
# --network jenkins \ # attach container to network
# --network-alias docker \ # set container alias
# --env DOCKER_TLS_CERTDIR=/certs \ # set environment
# --volume jenkins-docker-certs:/certs/client \ # set volume
# --volume jenkins-data:/var/jenkins_home \ # set volume
# --publish 2376:2376 \ # publish port
# --publish 8080:8080 \ # publish port
# --publish 50000:50000 \ # publish port
# jenkins/jenkins:jdk17 # image name
docker run \
--name container_name \
--restart=unless-stopped \
--detach \
--privileged \
--network app_name_network \
--env ENVIRONMENT=dev \
--volume localpath:dockerpath \
--publish outsideport:dockerinsideport \
image_name