sudo apt update
sudo apt remove docker docker-engine
sudo apt install -y \
    linux-image-extra-$(uname -r) \
sudo apt install \
    apt-transport-https \
    ca-certificates \
    curl \
curl -fsSL | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] \
   $(lsb_release -cs) \
sudo apt update
sudo apt install docker-ce

Docker run

root@ubuntu1604-sand:~# docker run -it ubuntu
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
ae79f2514705: Pull complete
5ad56d5fc149: Pull complete
170e558760e8: Pull complete
395460e233f5: Pull complete
6f01dc62e444: Pull complete
Digest: sha256:506e2d5852de1d7c90d538c5332bd3cc33b9cbd26f6ca653875899c505c82687
Status: Downloaded newer image for ubuntu:latest

Misc checker


  • interface
    root@ubuntu1604-sand:~# ip a
    3: docker0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state UP group default
      link/ether 02:42:b7:f3:14:1b brd ff:ff:ff:ff:ff:ff
      inet scope global docker0
         valid_lft forever preferred_lft forever
      inet6 fe80::42:b7ff:fef3:141b/64 scope link
         valid_lft forever preferred_lft forever
  • docker network
    root@ubuntu1604-sand:~# docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    db4c63b9a818        bridge              bridge              local
    d481d6a6b105        host                host                local
    d89ef5fa06f3        none                null                local
  • docker network inspect
    root@ubuntu1604-sand:~# docker network inspect bridge
          "Name": "bridge",
          "Id": "db4c63b9a818a99458c52f7818635cc00fd77b15b03b0e4b70a4e37760bbc94f",
          "Created": "2017-10-18T07:27:23.090097897Z",
          "Scope": "local",
          "Driver": "bridge",
          "EnableIPv6": false,
          "IPAM": {
              "Driver": "default",
              "Options": null,
              "Config": [
                      "Subnet": ""
          "Internal": false,
          "Attachable": false,
          "Ingress": false,
          "ConfigFrom": {
              "Network": ""
          "ConfigOnly": false,
          "Containers": {},
          "Options": {
              "": "true",
              "": "true",
              "": "true",
              "": "",
              "": "docker0",
              "": "1500"
          "Labels": {}
  • docker run -itd ubuntu
  • docker attach
  • Ctrl+p + Ctrl+q
  • containerのお掃除
    docker ps |awk '{print $1}' | grep -v CONTAINER | xargs -l docker rm -f
  • burst 起動
    root@ubuntu1604-sand:~# for i in [1 2 3 4 5]; do docker run -itd ubuntu; done

To help the humans, Docker also supplies containers with a randomly-generated name from two words, joined by an underscore, e.g. evil_ptolemy. This can make it easier to tell one container from another, but the random names don’t give any more insight into the container function than the UUID.
- -

root@ubuntu1604-sand:~# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
6ed929c157b3        ubuntu              "/bin/bash"         About an hour ago   Up About an hour                        thirsty_joliot
6a23db61e574        ubuntu              "/bin/bash"         About an hour ago   Up About an hour                        priceless_saha
930a48641895        ubuntu              "/bin/bash"         About an hour ago   Up About an hour                        flamboyant_hodgkin
a357bec9ce4e        ubuntu              "/bin/bash"         About an hour ago   Up About an hour                        fervent_yalow
  • tmux
  • ip reachiablity check
    apt update
    apt install -y iputils-ping net-tools 
  • netstat -untap
  • ping-pong
    #ping <some container's ip address>



  • Procedure for docker official