Docker and docker compose deployment

1. Docker deployment

1.1 mode 1:
  • Download software source
wget -O /etc/yum.repos.d/docker-ce.repo
sed -i '' /etc/yum.repos.d/docker-ce.repo
  • install
yum install docker-ce -y
  • start-up
systemctl enable docker
systemctl start docker
1.2 mode 2:
  • Install some necessary system tools:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
  • Add software source information:
sudo yum-config-manager --add-repo
  • Update yum cache:
sudo yum makecache fast
  • To install docker Ce:
sudo yum -y install docker-ce
  • To start the Docker background service:
sudo systemctl start docker
sudo systemctl enable docker
  • Test run Hello World:
docker run hello-world
1.3 mode 3:
  • Update yum package
sudo yum update
  • Execute the Docker installation script, which will add the docker.repo source and install Docker.
curl -fsSL -o
sudo sh
  • Start Docker process
sudo systemctl start docker
sudo systemctl enable docker
  • Verify that Docker is installed successfully and perform a test image in the container.
sudo docker run hello-world
docker ps

2. docker acceleration:

curl -sSL | sh -s
systemctl restart docker.service


sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
  "registry-mirrors": [""]
sudo systemctl daemon-reload
sudo systemctl restart docker

3. Deploy docker compose

3.1 mode I
curl -L`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
3.2 mode 2
yum update -y
yum install docker epel-release python-pip -y
pip install --upgrade pip
pip install docker-compose

Tags: Linux Docker sudo yum pip

Posted on Sun, 02 Feb 2020 11:40:32 -0500 by madhavanrakesh