zoukankan      html  css  js  c++  java
  • Docker-1

    Step 1 — Installing Docker
    sudo apt-get update
    sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
    sudo apt-get update
    apt-cache policy docker-engine
    sudo apt-get install -y docker-engine
    sudo systemctl status docker

    Step 2 — Executing the Docker Command Without Sudo (Optional)
    sudo usermod -aG docker $(whoami)
    sudo usermod -aG docker username

    Step 3 — Using the Docker Command
    docker [option] [command] [arguments]
    docker
    docker info

    Step 4 — Working with Docker Images
    docker run hello-world
    docker search ubuntu
    docker pull ubuntu
    docker run ubuntu
    docker images

    Step 5 — Running a Docker Container
    docker run -it ubuntu
    apt-get update
    apt-get install -y nodejs

    exit

    Step 6 — Committing Changes in a Container to a Docker Image

    When you commit an image, the new image is saved locally, that is, on your computer. Later in this tutorial, you'll learn how to push an image to a Docker registry like Docker Hub so that it may be assessed and used by you and others.
    docker commit -m "What did you do to the image" -a "Author Name" container-id repository new_image_name
    docker commit -m "added node.js" -a "Sunday Ogwu-Chinuwa" d9b100f2f636 finid/ubuntu-nodejs
    docker images


    Step 7 — Listing Docker Containers
    docker ps
    docker ps -a
    docker ps -l
    docker stop container-id

    Step 8 — Pushing Docker Images to a Docker Repository
    docker login -udocker-registry-username
    docker push docker-registry-username docker-image-name

    两种方法让一个image发生update

    (1)使用docker commit 将container的change写入到本地对应的image,然后 docker push 将本地image 推送到docker repo

    (2)使用dockerfile去update一个image,然后docker push 将本地image 推送到docker repo

  • 相关阅读:
    Linux Shell脚本Ldd命令原理及使用方法
    没有判断好形势,哪怕再多的传感器说有问题,核心的那个几仪表就是在歌舞升平
    JVM
    leetcode第一刷_Count and Say
    html 前台通用表单
    BP神经网络算法学习
    flash的dragonbone插件导入cocos2d的注意事项
    445port入侵具体解释
    google域名邮箱申请 gmail域名邮箱申请(企业应用套件)指南
    SQL性能优化工具TKPROF
  • 原文地址:https://www.cnblogs.com/chaseblack/p/6060993.html
Copyright © 2011-2022 走看看