What is Antsle?

Antsle is essentially a private Devops environment which is a Edge Linux server sitting on my desk. I find the Antsle to be a great sandbox to learn about Devops which allows me to spin up servers ala AWS, mess with them, blow them up, trash them and start over.

Configure IP Address

Note: If you’re not logged in as root you will need to prefix all your commands with sudo. If you want to switch to root so your don’t have to bother sudo run:

sudo -i

Update the interfaces file to add a dhcp address:

vi /etc/network/interfaces

… update the file to:

auto eth1
iface eth1 inet dhcp

If you want to configure a static ip use the following instead:

auto eth1
iface eth1 inet static
 address 192.168.1.105
 netmask 255.255.255.0
 gateway 192.168.1.1
 dns-nameservers 192.168.1.1

Or if you’re on a Mac:

auto eth1
iface eth1 inet static
 address 10.0.0.105
 netmask 255.255.255.0
 gateway 10.0.0.1
 dns-nameservers 10.0.0.1

Restart network service:

ifup eth1

Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth1/52:54:00:f3:90:b5
Sending on   LPF/eth1/52:54:00:f3:90:b5
Sending on   Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3 (xid=0xebfd814c)
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6 (xid=0xebfd814c)
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 11 (xid=0xebfd814c)
DHCPREQUEST of 10.0.0.18 on eth1 to 255.255.255.255 port 67 (xid=0x4c81fdeb)
DHCPOFFER of 10.0.0.18 from 10.0.0.1
DHCPACK of 10.0.0.18 from 10.0.0.1
bound to 10.0.0.18 -- renewal in 255291 seconds.

The dynamic IP address given to me is 10.0.0.18, (I’m on a Mac). Let’s ping the address to confirm that it’s available on our local net.

ping 10.0.0.18
PING 10.0.0.18 (10.0.0.18): 56 data bytes
64 bytes from 10.0.0.18: icmp_seq=0 ttl=64 time=1.038 ms
64 bytes from 10.0.0.18: icmp_seq=1 ttl=64 time=0.931 ms
64 bytes from 10.0.0.18: icmp_seq=2 ttl=64 time=0.302 ms
64 bytes from 10.0.0.18: icmp_seq=3 ttl=64 time=0.295 ms
64 bytes from 10.0.0.18: icmp_seq=4 ttl=64 time=0.374 ms
^C
--- 10.0.0.18 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.295/0.588/1.038/0.327 ms

Install Docker Engine

Update the apt package index and install packages to allow apt to use a repository over HTTPS:

apt-get update

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Before we can use curl to add Docker’s official GPG key we need to update our new antlet, (in my case antlet10) to the host file otherwise we will get the error: unable to resolve host antletXX.

vi /etc/hosts

# /etc/hosts
127.0.0.1   localhost
127.0.0.1   antlet10

Now we can add the GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Then we are supposed to verify that we have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

apt-key fingerprint 0EBFCD88
pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub   4096R/F273FCD8 2017-02-22

Next we setup the stable Docker repository:

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Install Docker Engine

The official Docker docs tell us to use the latest version of Docker Engine:

apt-get update
apt-get install docker-ce docker-ce-cli containerd.io

On my Ubuntu LXC Antlet I got an error installing the most recent version of Docker Engine and while searching the web for a fix I found this handy work-around which is installing an earlier version of Docker Engine.

apt-get update
apt install docker-ce=17.09.1~ce-0~ubuntu

Now we verify that all is well by running the hello-world image:

docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

Last but not least, we install Docker Compose.

Install Docker Compose

Run the following to install the latest version of Docker Compose:

curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Set executable permissions to the binary:

chmod +x /usr/local/bin/docker-compose

Test our version of Docker Compose:

docker-compose --version