jeffcook
Intern
Intern
  • UID2124
  • Fans0
  • Follows0
  • Posts1
Reads:521Replies:0

Alibaba Cloud Tech Share – get you first docker for centos

Created#
More Posted time:Feb 28, 2017 22:13 PM
First, create ECS instance,
This is mine:
Choose the Instance Type: 1-core, 2 GB
OS: CentOS 7.2 64bit
Sign up you Docker Hub https://hub.docker.com/
Create Repository
Docker ID:MyDocker
Password:MyPasswd
such as :MyDocker/CentosName
Do not talk too much nonsense here
let's go
install docker:
[root@camkx0zqi08irwZ ~]# sudo yum -y update
[root@camkx0zqi08irwZ ~]# curl -sSL https://get.docker.com/ | sh
[root@camkx0zqi08irwZ ~]# sudo service docker start
[root@camkx0zqi08irwZ ~]# docker run -itd -p 80:80 centos  /bin/bash
a4gdfb546ergdfhdfhfgggdfggdrty
[root@camkx0zqi08irwZ ~]# docker attach a4


Now you can change you os...
ok
To detach the tty without exiting the shell, use the escape sequence Ctrl+p + Ctrl+q.


[root@camkx0zqi08irwZ ~]# docker ps
a4gdfb546ergdfhdfhfgggdfggdrty
[root@camkx0zqi08irwZ ~]# docker commit a4 MyDocker/CentosName:First
[root@camkx0zqi08irwZ ~]# docker login -u MyDocker -p MyPasswd
[root@camkx0zqi08irwZ ~]# docker push MyDocker/CentosName:First
ok run you images Anywhere.
Its that simple.
Guest