zoukankan      html  css  js  c++  java
  • docker guide

    centos docker community version install:

    yum -y install docker         # install docker
    systemctl start docker.service               # start docker service
    systemctl enable docker.service       # enale docker service when power on
    docker run hello-world  # need to pull from docker repository the first time


    docker container:

    docker build -t friendlyname . # Create image using this directory's Dockerfile
    docker run -d -p 4000:80 friendlyname # detached mode,4000(image) 80(localhost)
    docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
    docker container ls # List all running containers
    docker container ls -a # List all containers, even those not running
    docker container stop <hash> # Gracefully stop the specified container
    docker container kill <hash> # Force shutdown of the specified container
    docker container rm <hash> # Remove specified container from this machine
    docker container rm $(docker container ls -a -q) # Remove all containers
    docker image ls -a # List all images on this machine
    docker image rm <image id> # Remove specified image from this machine
    docker image rm $(docker image ls -a -q) # Remove all images from this machine
    docker login # Log in this CLI session using your Docker credentials
    docker tag <image> username/repository:tag # Tag <image> for upload to registry
    docker push username/repository:tag # Upload tagged image to registry
    docker run username/repository:tag # Run image from a registry


    docker services:

    docker swarm init # first time you deploy an app or after you shutdown the swarm
    docker stack ls # List stacks or apps
    docker stack deploy -c <composefile> <appname> # Run the specified Compose file
    docker service ls # List running services associated with an app
    docker service ps <service> # List tasks associated with an app
    docker inspect <task or container> # Inspect task or container
    docker container ls -q # List container IDs
    docker stack rm <appname> # Tear down an application
    docker swarm leave --force # Take down a single node swarm from the manager


    docker swarm:

    docker pull docker.io/vickeywu/docker_test:test
    or docker run -p 8080:8080 vickeywu/docker_test:test
    curl localhost:8080
    rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    yum -y install kernel-devel kernel-headers dkms
    yum -y groupinstall "Development Tools"
    yum -y update
    wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
    rpm --import oracle_vbox.asc
    wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
    yum -y install VirtualBox-5.1
    systemctl start vboxdrv.service
    usermod -a -G vboxusers root

    references:

    install:http://www.linuxidc.com/Linux/2014-12/110034.htm

    container:https://docs.docker.com/get-started/

     swarm:http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-virtualbox-4-3-on-centos-7-rhel-7.html

  • 相关阅读:
    10分钟教你Python+MySQL数据库操作
    10分钟教你用eclipse上传代码到GitHub
    分享几个有趣的程序代码(有些还是值得学习的哦)~
    10分钟教你生成超高逼格微信朋友圈
    1.maven中pom.xml文件中<exclusions>标签认不到问题
    2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found.
    1. SpringBoot启动后,报异常:This application has no explicit mapping for /error, so you are seeing this as a fallback.
    9. 一个list拆分成多个list返回
    12. myeclipse遇到Initializing java tooling(1%)终极解决办法
    42. oracle通过两张表的一个字段对应,update其中一张表的某个字段
  • 原文地址:https://www.cnblogs.com/vickey-wu/p/7978172.html
Copyright © 2011-2022 走看看