Skip to main content

How To install Docker in Linux Mint 18.2

How To install docker in Linux Mint 18.2 Codename: sonya

Docker is a Container as a service (CaaS) platform which helps to eliminate "works in my computer" problems when working together with other members in the team. More here
Docker Image
Docker for Linux Mint is availabe as a free Community Edition (CE). Installation is easy and straigh forward. We will install a stable release of docker.
OS Requirements
  • Linux Mint 18.2 (LTS)
  • Architecture: x86_64
If you've the older version installed already, uninstall it
$ sudo apt-get remove docker docker-engine docker.io
Add repositories
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Since, Linux Mint 18.2 (sonya) is based on Ubuntu 16.04 (xenial), we've to use the release codename of Ubuntu 16.04 i.e. xenial. Also, we'll use the latest stable version
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
If you are using Linux Mint 16 (petra), you've to use the release codename "trusty"
To check the release codename of you Linux Mint pc, In your terminal type:
lsb_release -rc
You'll see the release and codename printed in the terminal as
Release: 18.2
Codename: sonya
Now, update the pc
$ sudo apt update

Finally, we'll Install docker community version (CE) in Linux mint 18.2

$ sudo apt install docker-ce
Check if the docker is properly installed by typing
$ docker version
You'll get the output like this:
Client:
 Version:      17.06.2-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 20:00:17 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.06.2-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 19:59:11 2017
 OS/Arch:      linux/amd64
 Experimental: false
 Running hello world in docker is easy, Just run
$ sudo docker run hello-world
You must be root user to use docker

Running docker command as non root user

If you are a single user and don't want to enter your password everytime while executing docker command, you have to add the current user in docker group.
$ sudo groupadd docker #this is most likely already created while installing docker
$ sudo gpasswd -a $USER docker
$ newgrp docker # you might need to logout if the changes are not working
$ docker run hello-world # check if docker is working without sudo

Comments

  1. Might be useful. Can't tell with the black text on dark blue background for all of the code segments...

    ReplyDelete
  2. Nice simple article, the only think is that I found difficult to read the code, maybe with a white font it could be easier.

    ReplyDelete

Post a Comment

Popular posts from this blog

Live video streaming with ffmpeg and ffserver

Live video and audio streaming with ffmpeg and ffserver This is a guide on how to stream video using ffserver and ffmpeg in ubnutu. The ffmpeg ffserver version used is 3.3-1~16.04.york1. You can download ffserver from ffmpeg.org . I'm using linux mint 18. So, I've downloaded ffmpeg from the repository. You can follow the link below to install the latest version of ffmpeg. Install ffmpeg in linux mint 18 using command line . First, we need to setup our ffserver.conf to stream the audio and video properly. ffserver.conf file is usually located in /etc/ffserver.conf. You can either edit the ffserver.conf or create your own .conf file. I'll be creating my own .conf file named livestream.conf In console, type sudo nano /etc/livestream.conf Blank .ffm file will be created. Now, enter the required properties for streaming live video using ffserver #Default port HTTPPort 8090 HTTPBindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 100000 Custo

Handling unexpected runtime exception inside Thread. thread.setUncaughtExceptionHandler

Create and set UncaughtExceptionHandler before starting new thread to catch unexpected runtime exception in Multithreading application. package demo; public class ExceptionHandler {     public static void main(String[] args) {         Thread thread = new Thread(new Runnable() {             @Override             public void run() {                 throw new RuntimeException("Critical Error");             }         });         System.out.println("Starting new thread " + Thread.currentThread().getName());         //Throw this exception if any exception has occurred inside running thread but was not caught anywhere else         //This should be set before starting the new thread         thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {             @Override             public void uncaughtException(Thread thread, Throwable throwable) {                 System.out.println("Error occurred on thread: " + thread.getName() + ". Reason :

How to run Spring Boot application inside docker container

Step by Step procedure in creating and running a simple Spring Boot application inside docker container This tutorial will show you on how to run simple Spring Boot application inside docker container. If you have not installed docker already, please install it first. I'm using Linux Mint 18.2. You can follow these steps on How To install Docker in Linux Mint 18.2 After you've successfully installed docker in your machine, let's create a docker image that will run inside the container. Create a simple Spring Boot project from here . Select Web as a dependency. Import the project into you IDE, I'm using Spring Tool Suite. Create a controller and name it HelloController. You can name your controller anything you like. Create a method that will map the request and return a response. Create Dockerfile at the root of the project. The name is important here, only the letter D is capital Make the following entries inside the Dockerfile #Enter all the requi