ECS uses docker to build services

Posted by Warmach on Wed, 16 Oct 2019 05:14:21 +0200

Premise: Amazon cloud has been configured to start.

The inbound policy of security group is as follows:


The outbound strategy is as follows:

After logging in to EC2, only EC2 user can log in by default, and then switch to root:

sudo su

Prompt for installing docker no package docker available using yum.

yum install docker -y


resolvent:
Add CentOS7-Base-163.repo file under / etc/yum.repos.d /.

vi CentOS7-Base-163.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/7/os/x86_64
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/7/updates/x86_64
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/7/extras/x86_64
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/x86_64
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

After saving and exiting, execute the command:

yum makecache

Then execute the yum install docker command:

yum install docker -y

After installation, it is as follows:


To start docker:

## Start docker service
systemctl start docker
chkconfig docker on

To view the docker version:

docker version


Pull docker image:

OK, now let's pull the docker image made by others directly. The shadow lock VPN docker image on github is selected here. Execute the following command directly:

docker pull oddrationale/docker-shadowsocks


To run docker image:

Run the following command to start the docker image.

docker run -d -p 8001:8001 oddrationale/docker-shadowsocks -s 0.0.0.0 -p 8001 -k yourpassword-m aes-256-cfb


Run docker ps -a to see if the container has run successfully.

docker ps -a


Call curl on linux:

curl -k localhost:8001


Call curl on windows:

Echo that the above instructions have been deployed, and what you need to do next is your business...

This public account provides free csdn download service and massive it learning resources. If you are ready to enter the IT pit and aspire to become an excellent program ape, these resources are suitable for you, including but not limited to java, go, python, springcloud, elk, embedded, big data, interview materials, front-end and other resources. At the same time, we have set up a technology exchange group. There are many big guys who will share technology articles from time to time. If you want to learn and improve together, you can reply [2] in the background of the public account. Free invitation plus technology exchange groups will learn from each other and share programming it related resources from time to time.

Scan the code to pay attention to the wonderful content and push it to you at the first time

Topics: Go Docker CentOS yum RPM