So we will be installing community edition. $ echo "deb $(lsb_release -cs) stable" | sudo tee /etc/apt//docker.list > /dev/null Step 3) Install Docker with Apt CommandĪs Docker comes into two editions, community and enterprise. To enable docker repository, run below commands, $ curl -fsSL | sudo gpg -dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg Though the docker packages are available in default package repositories but it is recommended to use docker official repository. $ sudo apt install -y ca-certificates curl gnupg lsb-release Step 2) Enable Docker Official Repository Login to Ubuntu 22.04 /20.04 system and run the following apt commands to install docker dependencies, $ sudo apt update Let’s deep dive into Docker installation steps on Ubuntu 22.04 / 20.04. Ubuntu 22.04 / 20.04 along with ssh access.If you ran into any trouble, hit me up in the comments or socials/email and don’t forget to sign up to my newsletter for all the latest news and guides delivered to your inbox: Newsletter Sign Up. I hope you enjoyed this introduction to Docker on Raspberry Pi and if you want to learn more, look at the Further Reading section below and check out this Getting Started Guide. To stop the Apache instance, use the following command: docker stop apache-httpd Conclusion If you get the default Apache test page “It Works!” then you’re good to go. Enter the IP address into your web browser and hit ENTER (you may get a security warning, click Continue) Look for the eth0 interface which will show your RPi’s IP address. We need to find the IP address of your Raspberry Pi, enter the ip address command: ip address -p – Map local computers port to Apaches port, in this case port 80 80:80ĭocker run -d -name apache-httpd -p 80:80 -d httpd.-name – The name of the deployment, I have named it apache-httpd.I will give an explanation of each option: Let’s check that we have httpd and hello-world images available: docker images First, let’s pull the image: docker pull httpd Now for something a little more serious, let’s deploy the Apache HTTP server container. Then deploy the container: docker run -it hello-world Deploy Apache HTTP Server Container First, we “pull” the image from the Docker repo: docker pull hello-world Let’s deploy our first Docker container called “Hello World” which will display a greeting from Docker on the screen. So that you don’t have to add sudo for Docker commands, we add user pi to the Docker group (we’re using the $ Deploy ‘Hello World’ Container Let’s make sure everything went OK and Docker is installed and running: sudo systemctl status docker Add User ‘pi’ to Docker Group Let’s update the apt cache now that we have the Docker repo source: sudo apt updateĪnd install Docker community edition: sudo apt install docker-ce -y Let’s add the Docker GPG key: curl -fsSL | sudo gpg -dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgĪnd add the Docker repo to the sources.list file: echo "deb $(lsb_release -cs) stable" | sudo tee /etc/apt//docker.list > /dev/null Let’s install some required software that apt needs to upgrade packages over HTTPS: sudo apt install curl ca-certificates apt-transport-https software-properties-common Your RPi will need Ubuntu Server Edition installedīefore we install Docker, let’s update the cache and upgrade software: sudo apt update & sudo apt upgrade -y.You’ll need a a RPi-3, RPi-4, RPi-400, or Zero.Docker has an image repository of thousands of pre-configured applications like Apache HTTP server (which we’ll install later in this guide), Ubuntu, Python, Postgres, Node.js, and many others (I’ll give you links at the end of this tutorial). We’ll also deploy an Apache HTTP server, and I’ll give you some good resources to learn from.įYI: Docker is an application that enables “containerized” apps similar to a virtual machine. In this guide I’ll show you how to install Docker on a Raspberry Pi running Ubuntu Server Edition for a complete Docker portable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |