Jack Wallen shows you how to install Docker on your Chromebook so you can start building containers on the go.
Chromebooks are great mobile devices because they’re easy to use, secure, and fast. For those reasons, Chromebooks could be great development devices. And if Docker is your development environment of choice, you’re in luck. Thanks to Linux, it’s possible to install Docker on ChromeOS so you can work your container development magic on the go with ease.
I’ll show you how to install Docker on ChromeOS, a task you should be able to complete in a few minutes.
SEE: Hiring Kit: Back-End Developer (TechRepublic Premium)
What you’ll need to install Docker
To install Docker, you’ll need a Chromebook with an up-to-date version of ChromeOS.
How to add Linux to your Chromebook
The first thing you need to do is enable Linux on your Chromebook. This is done by going to Settings | Advanced | Developers. There, you will find the Linux Development Environment listed.
Click Activate (Figure A) and follow the instructions on the screen. This process will take a few minutes to complete, but once it’s done, you’ll see a terminal window open, where you can start using Linux on your Chromebook.
How to install Docker
From the now open Linux terminal window, update apt with the command:
sudo apt-get update
Once apt has been updated, install the required dependencies with the command:
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
With dependencies out of the way, download and install the official Docker GPG key with:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
Add the required fingerprint:
sudo apt-key fingerprint 0EBFCD88
Add the official Docker repository with the command:
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable”
Update apt with the command:
sudo apt-get update
Finally, install Docker with:
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
Next, you need to add your user to the docker group with the command:
sudo usermod -aG docker $USER
Close the Linux terminal and sign out of your Chromebook. Log back in, open the Linux terminal app, and you should now be able to run the docker command without sudo, which would be a security risk.
How to test the container implementation
Test your new installation by running the Hello World container with the command:
docker run hello-world
You should be greeted by the text Hello World in the terminal window. Another example would be to deploy the NGINX container with the command:
docker run --name docker-nginx -p 8080:80 -d nginx
Test the implementation with the command:
You should see the text output of the NGINX welcome page, which includes the line “Thank you for using nginx”. You can also open the Chrome web browser on your Chromebook and point it to 0.0.0.0:8080 and see the splash screen in the browser (Figure B).
Congratulations, you can now develop with Docker on your Chromebook. At this point Docker should work as expected and you can build your containers and stacks as usual.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube to get the latest tech tips for business professionals from Jack Wallen.