set up docker and run httpd in 2 vagrant machines. 1

2429 단어 Docker

overview


Mac에 vagrant machine 2대를 준비하고 httpd를 만드는 이미지 1대를 사용하고 httpd를 1대로 시작하고 싶습니다.
  • set up docker in vagrant_1
  • docker pull
  • docker run
  • docker push
  • set up vagrant_2
  • set up docker in vagrant_2
  • docker pull
  • docker run
  • Set up Vagrant machine and centOS7


    in your local Mac.
    bash
    vagrant box add centos7_2 https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.2/vagrant-centos-7.2.box
    
    bash
    mkdir docker_1
    
    bash
    cd docker_1
    
    bash
    vagrant init centos7_2
    
    bash
    vi Vagrantfile
    
    Change IP address
    Vagrantfile
    config.vm.network "private_network", ip: "192.168.55.44"
    
    bash
    vagrant up
    
    Login to virtual machine
    bash
    vagrant ssh
    

    Set up docker in CentOS7


    check linux version
    bash
    cat /etc/redhat-release
    #CentOS Linux release 7.2.1511 (Core)
    
    yum update
    bash
    sudo yum -y update
    
    bash
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    
    bash
    sudo yum-config-manager \
        --add-repo \
        https://download.docker.com/linux/centos/docker-ce.repo
    
    bash
    sudo yum-config-manager --enable docker-ce-edge
    
    bash
    sudo yum-config-manager --enable docker-ce-testing
    
    bash
    sudo yum makecache fast
    
    bash
    sudo yum install -y docker-ce
    
    bash
    sudo systemctl start docker
    
    bash
    sudo docker run hello-world
    
    b04784fba78d: Pull complete 
    Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
    Status: Downloaded newer image for hello-world:latest
    
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    
    그다음에 여기.

    좋은 웹페이지 즐겨찾기