Differences between revisions 15 and 16
Revision 15 as of 2018-03-17 02:13:10
Size: 1863
Editor: PieterSmit
Comment:
Revision 16 as of 2018-06-14 23:17:42
Size: 2093
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
   * connect to a running docker attache to main terminal. (attach or exec new app)
     {{{ docker exec -it <<docker ps #id>> /bin/bash }}}
   
   * Find docker details e.g. ip
     {{{ docker inspect <container id> }}}

linux docker notes

  • Links docker-compose , Docker&Oracle-java , Containers

  • On Ubuntu
    • install docker
    • add user to docker group, logout and log in again
      •  adduser Me docker 

    • Flags
      • -t pseudo-TTY
      • -i --interactive
      • --name "NameContainer"

      • --publish=[] format ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort
      • -e, --env=[] Set environment variables
      • --add-host=[] Add a custom host-to-IP mapping (host:ip)
      • --rm Automatically remove the container when it exits
    • docker search ubuntu:14.04
      •  $ docker search ubuntu:14.04   $ docker search --no-trunc --stars=1 etcd 

    • downloaded images
      •  docker images 

    • run interactively
      •  $ docker run -it ubuntu:14.04 

         $ docker run -it -v ~/docker:/docker ubuntu:14.04 

         $ docker run -it -v ~/docker:/docker -v /dev/log:/dev/log ubuntu:14.04 

    • view running images and historic
      •  $ docker ps -a 

    • connect to a running docker attache to main terminal. (attach or exec new app)
      •  docker exec -it <<docker ps #id>> /bin/bash 

    • Find docker details e.g. ip
      •  docker inspect <container id>  

    • set default resolve.conf dns servers.
      • create/edit $ sudo gvim /etc/docker/daemon.json
        •        {
                  "dns": ["8.8.8.8", "8.8.4.4"]
                 }
    • commit a new image
      1. run and make changes.
      2. exit
      3. commit and save as new image
        •        $ docker commit -m "My Image Test01" -a "My Name" 37bf99224fce myimg01
                 sha256:4b439bc2347b744a405ae6a60862906442e461eddd33d0496dff322060fe837b
      4. run new image. $ docker run -it -v ~/docker:/docker myimg01
  • re-run exited image.
    • docker start xxxxxx
    • docker exec xxxxxx /bin/bash

docker (last edited 2023-09-21 21:03:25 by PieterSmit)