Docker and docker compose setup on ubuntu 16.04

Requirement:-

1.RAM minimum 2GB .
2.Install Java 8 or more 

Install Java :-

sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-set-default

Install Docker :-

1. sudo apt-get update


2.sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

Add Docker’s official GPG key:
 
 3. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  sudo apt-key fingerprint 0EBFCD88
 
 amd64:
 sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) \
     stable"
armhf:
$ sudo add-apt-repository \
   "deb [arch=armhf] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
   stable"
s390x:
$ sudo add-apt-repository \
   "deb [arch=s390x] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
   stable"
4. sudo apt-get update
   
 5. sudo apt-get install docker-ce
NOTE:-
To install specific version :- sudo apt-get install docker-ce=17.03.*
Now you can check by typing command 
 
6. docker ps
 

How to remove sudo from docker :-

 


To remove sudo , we have to add user into docker group .
> sudo usermod -aG docker $(whoami)
> sudo service docker stop
> sudo service docker start
If you are again getting error ,then give permission to
> ls -l /var/run/docker.sock
 > sudo chown $(whoami) /var/run/docker.sock
then type 
> docker ps
Install Docker Compose on Linux systems
On Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub. Follow the instructions from the link, which involve running the curlcommand in your terminal to download the binaries. These step by step instructions are also included below. 1. Run this command to download the latest version of Docker Compose:
sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

Use the latest Compose release number in the download command.
The above command is an example, and it may become out-of-date. To ensure you have the latest version, check the Compose repository release page on GitHub.
If you have problems installing with curl, see Alternative Install Options.
Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose 
Optionally, install command completion for the bash and zsh shell. 
Test the installation.
docker-compose --version


Upgrading Docker compose


docker-compose migrate-to-labels

Uninstallation Docker compose


To uninstall Docker Compose if you installed using curl:
sudo rm /usr/local/bin/docker-compose
To uninstall Docker Compose if you installed using pip:
pip uninstall docker-compose

Uninstall Docker CE

sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker

Comments

Post a Comment