How to install Docker Machine on Linux Mint 18 and 18.1

Docker

If you’ve read and made use of this article to install Docker on Linux Mint 18 or 18.1, this is the next article in line.

While installing Docker makes it possible to run Docker containers locally on your machine, installing Docker Machine makes it possible to provision servers locally and remotely on supported Cloud service providers like DigitalOcean and AWS with Docker (Engine) pre-installed. Such servers are called Dockerized hosts or managed machines.

So in this article, you’ll learn how to install Docker Machine on Linux Mint 18 or 18.1, with an eye towards using it to provision such machines.

Download and Install Docker Machine

Installing Docker Machine involves downloading its binary to your computer, copying it to the appropriate directory and making it executable. The commands required to get all that done are given in this code block. Note that at the time of this publication, Docker Machine 0.8.2 is the latest, stable release. The development branch is at v0.9.0 RC2. You might want to keep track of the very latest release here.

# Download the Docker Machine binary for Linux

wget https://github.com/docker/machine/releases/download/v0.8.2/docker-machine-$(uname -s)-$(uname -m)

# A file called docker-machine-Linux-x86_64 is now on your computer
# Move it to the /usr/local/bin directory, renaming it to docker-machine in the process

sudo mv docker-machine-Linux-x86_64 /usr/local/bin/docker-machine

# Make it executable

sudo chmod +x /usr/local/bin/docker-machine

# Verify that it's installed

docker-machine version
# Output follows
> docker-machine version 0.8.2, build e18a919

#

Install Extra Bash Scripts

With Docker Machine installed, there are three additional Bash scripts needed to be installed that will make using the docker-machine command a bit easier. The scripts, and the functionality they bring to the table, are:

  • docker-machine.bash: This provides command completion for commands, machine names and filepaths
  • docker-machine-prompt.bash: This makes it possible to see the active machine in your shell prompt
  • docker-machine-wrapper.bash: This adds a docker-machine use subcommand to switch the active machine
Related Post:  Understanding Docker Networking Drivers and their use cases

The three Bash scripts will need to be linked to the /etc/bash_completion.d directory. The following commands shows how to link all three scripts:

# Each command will download and link each file to the appropriate directory
# For the first file, use this command

sudo wget https://raw.githubusercontent.com/docker/machine/master/contrib/completion/bash/docker-machine.bash \
 -O /etc/bash_completion.d/docker-machine.bash

# Use this for the second file

sudo wget https://raw.githubusercontent.com/docker/machine/master/contrib/completion/bash/docker-machine-wrapper.bash \
 -O /etc/bash_completion.d/docker-machine-wrapper.bash

# And for the third, use this

sudo wget https://raw.githubusercontent.com/docker/machine/master/contrib/completion/bash/docker-machine-prompt.bash \
 -O /etc/bash_completion.d/docker-machine-prompt.bash

#

That last file – docker-machine-prompt.bash – requires additional configuration. You need to modify the PS1 environment variable so that it would function correctly. The PS1 environment variable you need to modify is in the .bashrc file under your home directory. Use the follow commands to modify it.

# Open the .bashrc file

nano ~/.bashrc

# There are four lines starting with PS1, but look for the second occurrence, between else and fi
# It should read:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '

# Append $(__docker_machine_ps1) to it so that it reads:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\]$(__docker_machine_ps1) '

# Save and close the file
# To activate the change, type

source .bashrc

#

That’s all you need to do to install Docker Machine on Linux Mint 18 and 18.1. The next step is to start provisioning Dockerized hosts (machines) with it. That will be the subject of the next article, which will be published latest Friday, December 16 (2016).

Related Post:  Getting Started with Datadog Monitoring in Rancher

If you need to look at the code for the three Bash scripts, you’ll find them here. For more information on Docker Machine, click here.

Docker on Linux Mint 18

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer run network ads?  Yep, no more ads from the usual suspects that track and annoy you across the Internet. But since I still need to pay to keep the site running, feel free to make a small donation by PayPal or your favorite cryptocurrency.

  • Bitcoin
  • Ethereum
  • Xrp
  • Bitcoin cash
  • Bitcoin sv
  • Litecoin
  • Binance coin
  • Cardano
  • Ethereum classic
Scan to Donate Bitcoin to bc1qzvlte2m224zkayhdc7fdfjkp2rsgt0l5a496ua

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Scan to Donate Ethereum to 0x0F4362DFF77F3Ba0Dc637F5f3Eba35D09a2fA60C

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Xrp to r4ggjvL36njsMCYTkJ3S7cTHscPsMsSGQv

Donate Xrp to this address

Scan the QR code or copy the address below into your wallet to send some Xrp

Scan to Donate Bitcoin cash to qrs0dedzp9t55af3nfwypydghp29r0xguy9s20fz2k

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Bitcoin sv to 15K9TLyVDBtLuG9cYvXCX9SSkq9C9oUKHK

Donate Bitcoin sv to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin sv

Scan to Donate Litecoin to LetJ9QQMb7u2LMZ9Tu6rtHwcBcQFW98fbG

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Binance coin to bnb1ga8trq08ssqepd90v6225nzfgy448pu5pw8gxp

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Cardano to addr1qx2354yw49etstfljpdhwja3ajjlt487lg95vu9ngy2q6vu4rf2ga2tjhqknlyzmwa9mrm997h20a7stgectxsg5p5esq5l7d9

Donate Cardano to this address

Scan the QR code or copy the address below into your wallet to send some Cardano

Scan to Donate Ethereum classic to 0xcD6CC972a2297FcafACDcfE042C55C69516a9264

Donate Ethereum classic to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum classic

Subscribe for updates. Trust me, no spam!

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

Upcoming events

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest

On social media
Via my newsletter

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.