Task is to configure x86 bare metal machine as a docker host using Debian 8. You will need a network connection to the host to follow this guide. Also a connected keyboard and monitor.
- Host machine. I will be using an optiplex 760 but any machine will do.
- Internet connection. I will be using the net install Debian 8 image.
- About half an hour.
Step One: Prepare Boot-able USBDownload the debian 8 amd64 net install image from your favourite mirror. As for an example:
Download the check sums. We will be using SHA512SUMS, this file will be in the same directory as the above image.
$ sha512sum --check SHA512SUMS 2> /dev/null | grep 'netinst' debian-8.0.0-arm64-netinst.iso: OKThe above command runs
sha512sumand checks against the file we downloaded. We redirect stderr to /dev/null so we don't see error messages. Then we used grep to only see the result from the image we downloaded.
Now for the boot disk, we check our current device list
$ ls /dev/sd* OR # fdisk -lInsert a USB stick and re-run the above command. The new entry is the device you just plugged in. We then write the downloaded image to this device with the
ddrescuecommand. In this example we will use
$ ddrescue --force /path/to/debian-8.0.0-amd64-netinst.iso /dev/sdX
Did you use the right drive letter? Did you? If not, you'll be crying, right about now....
- Knoppix Wiki
Step Two: System InstallationWe can now insert the newly created USB device into our target machine and reboot.
Assuming that you have been able to boot from the USB you will now be faced with the debian installer. Select
Advanced Optionsand then
From here on select and complete all menu items except for
Select and Install Software. Do not select this step if you wish to install a minimal server setup.
You will have configured
/etc/apt/source.listduring the install process, if you like take a look and make sure it is as required. Then we will update the system and install basic software required to interact with the server.
# apt-get update # apt-get upgrade # apt-get -y less vim openssh-server curlLet's reboot the machine. Now you can ssh into the newly setup host from your usual workstation. Note, by default root login with password is disabled. You may want to configure ssh, this is done by editing the ssh deamon configuration file
/etc/ssh/sshd_configSee above link for how to change this behaviour. If you are lazy, like myself, and used a non-secure root password during setup now is the time to generate a secure one and store it in your favourite password manager (updating the server also of course). If you do not have a favourite password manager, may I suggest
Pass- The Standard Unix Password Manager.
Step Three: Docker installationYou now have a bare bones Debian 8 server instance. You can then install
# apt-get install docker.ioBut this may give you an error message:
Package 'docker.io' has no installation candidateFollowing the solution for Package 'docker.io' has no installation candidate error message, we have finally come to the actual docker installation. The installation of docker on Debian Jessie is simple as:
# curl -sSL https://get.docker.com/ | shAll done. If required, using your newly installed docker you can now also install your own private docker registry.