1. 程式人生 > >docker 解除安裝、安裝及配置

docker 解除安裝、安裝及配置

一、Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them:

         執行命令:sudo apt-get remove docker docker-engine docker.io

二、Install by DEB package

  1. Install Docker CE, changing the path below to the path where you downloaded the Docker package.

    $ sudo dpkg -i /path/to/package.deb
    

    The Docker daemon starts automatically.

  2. Verify that Docker CE is installed correctly by running the hello-world image.

    $ sudo docker run hello-world

三、Post config

To create the  docker group and add your user:

  1. Create the docker group

    $ sudo groupadd docker
    
  2. Add your user to the docker group

    $ sudo usermod -aG docker $USER
    
  3. Log out and log back in so that your group membership is re-evaluated.

    If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.

    On a desktop Linux environment such as X Windows, log out of your session completely and then log back in.

  4. Verify that you can run docker commands without sudo

    $ docker run hello-world
docker ps 檢視本地的image local_dev字樣的,然後

docker commit id  name(Registry大頭的)