# - - # # - - # # - - # # - Install docker on Ubuntu Server - # https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository # - - # # - Update - # sudo apt update; # - - # # - Install packages to allow apt to use a repository over HTTPS - # sudo apt install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common -y; # - - # # - Add Docker’s official GPG key - # curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # - - # # - Verify Docker fingerprint - # sudo apt-key fingerprint 0EBFCD88 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) sub rsa4096 2017-02-22 [S] # - - # # - uServer 20.04 - # sudo apt install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan test" # - - # # - Remove Docker - # # - Don't use this line - # #sudo add-apt-repository --remove \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" # - - # # - Install Docker CE - # # - - # # - Update the apt package index - # sudo apt update; # - - # # - Install latest Docker CE - # #sudo apt install docker-ce -y; sudo apt install docker.io -y; # - - # # - Add your user to the docker group - # # - Logout and login again - # sudo usermod -aG docker is_derayo; exit uSH / uSO # - - # # - Skip this on installation - # # - To install a specific version of Docker CE - # # - - # # - List the versions available in your repo - # apt-cache madison docker-ce; docker-ce | 18.03.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages docker-ce | 18.03.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages docker-ce | 17.12.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages # - - # # - To install a specific version of Docker CE - # sudo apt-get install docker-ce= # - - # # - Verify that Docker CE is installed correctly by running the hello-world image - # sudo docker run hello-world; Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/ # - - # # - Install docker-compose - # sudo -i curl -L https://github.com/docker/compose/releases/download/1.23.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose; docker version; docker-compose version; # - - # # - - # # - Docker commands - # # - After your user is in docker group you don't need sudo - # sudo docker version; docker --version; docker version; docker-compose --version; docker-compose version; # - - # # - phpMyAdmin throug docker - # https://medium.com/coderscorner/connecting-to-mysql-through-docker-997aa2c090cc # - - # # - Login uServerOffice & login as root - # ssh 192.168.1.100 sudo su # - - # # - Get docker info - # docker info; docker images; docker ps; docker run hello-world; # - - # # - Login docker MysQL - # docker exec -it mysql1 mysql -uroot -pAdministrator2; docker exec -it mysql1 mysql -u is_derayo -pAdministrator2; docker exec -it mysql1 mysql -uis_derayo -pAdministrator2 -h 192.168.1.20; docker exec -it mysql1 mysql -uis_derayo -pAdministrator2 -h 192.168.1.100; docker exec -it mysql1 mysql -uis_derayo -pAdministrator2 -h www.isdevelopment.us; # - - # # - Login docker MysQL bash - MySQL terminal - # docker exec -it mysql1 bash; cat /var/log/mysqld.log; # - - # # - Show images - # sudo docker images; REPOSITORY TAG IMAGE ID CREATED SIZE ghost latest 1375405e7316 10 days ago 572 MB ubuntu latest 113a43faa138 2 weeks ago 81.1 MB nginx latest cd5239a0906a 2 weeks ago 109 MB phpmyadmin/phpmyadmin latest 4bdc31ab2ded 4 weeks ago 164 MB portainer/portainer latest 50c62d83c09c 4 weeks ago 54.1 MB mysql latest a8a59477268d 6 weeks ago 445 MB httpd latest fb2f3851a971 7 weeks ago 177 MB hello-world latest e38bc07ac18e 2 months ago 1.85 kB registry latest d1fd7d86a825 5 months ago 33.3 MB # - - # # - Remove images - Use IMAGE ID - # docker rmi e38bc07ac18e; # - - # # - Once is running, you have to force it on removal - # docker rmi -f e38bc07ac18e; docker rmi -f e38bc07ac18e; Untagged: hello-world:latest Untagged: hello-world@sha256:f5233545e43561214ca4891fd1157e1c3c563316ed8e237750d59bde73361e77 Deleted: sha256:e38bc07ac18ee64e6d59cf2eafcdddf9cec2364dfe129fe0af75f1b0194e0c96 # - - # # - Stop container - # docker stop e38bc07ac18e; # - - # # - Show not active containers - # docker ps -a; # - - # # - Remove container - # docker rm e38bc07ac18e; # - - # # - To checkout the logs of the running container use the following command - # docker logs mysql1; # - - # # - Find the IP of the container using following - # # - Check out the “IPAddress” from the output, this will tell you the ip address - # docker inspect mysql1; # - - # # - docker pull phpmyadmin/phpmyadmin - # docker pull phpmyadmin/phpmyadmin; # - - # # - To link our existing MySQL container with phpMyAdmin application use the following - # docker run --name myadmin1 -d --link mysql1:db -p 8080:80 phpmyadmin/phpmyadmin; docker run --name myadmin2 -d --link mysql1:db -p 8181:80 phpmyadmin/phpmyadmin; That’s it! Now open up a browser and go to http://192.168.1.100:8181/