6/17/2023 0 Comments Sudo service docker start![]() Since WSL2 doesn’t run systemd, you cannot use systemd to automatically start Docker as you typically would in a Linux system. However, one piece of nuisance for me has been that the Docker daemon doesn’t automatically start, and there’s no ‘easy’ way to start it automatically. I hope you found this guide informative, please don’t hesitate to share your feedback and comments.įor more documentation on docker please refer : Docker DocumentationĪlso Read : How to Setup Local APT Repository Server on Ubuntu 20.I like running Docker containers in WSL2. Click on Continue and follow screen instructions to finish the installation. Great, above confirms that WordPress installation is started via docker-compose. Now try to access WordPress from the Web Browser by typing URL: Output of above command would like below:Ībove confirms that two containers are created successfully. To deploy the WordPress, run the below command from your project’s directory $ docker-compose up -d We are also creating the persistent volume for DB container and WordPress GUI is exposed on ‘8000’ port. WORDPRESS_DB_PASSWORD: #Īs we can see, we have used two containers one for WordPress web and other one is for database. $ mkdir wordpress cd wordpressĬreate a docker-compose.yaml file with following content. Create a project directory ‘wordpress’ using mkdir command. To test docker compose, let’s try to deploy WordPress using compose file. Perfect, above output confirms that docker compose of version 1.29.2 is installed. $ sudo chmod +x /usr/local/bin/docker-composeĬheck the docker-compose version by running following command, $ docker-compose -versionĭocker-compose version 1.29.2, build cabd5cfb To install docker compose on Ubuntu Linux, execute the following commands one after the another $ sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose Installation of Docker Compose on Ubuntu 22.04 / 20.04 Output of above ‘ docker run’ would look like below. If container displays the informational message, then we can say docker installation is successful. $ docker run hello-worldĪbove docker command will download ‘hello-world’ container image and then will spin up a container. To test and verify docker installation, spin up a ‘ hello-world’ container using below docker command. Step 4) Verify and Test Docker Installation Verify docker daemon service status, run below systemctl command $ sudo systemctl status dockerĪbove output confirms that docker daemon service is up and running. Verify the Docker version by executing following, $ docker version ![]() Note: Make sure logout and login again after adding local user to docker group Once the docker package is installed, add your local user to docker group so that user can run docker command s without sudo, $ sudo usermod -aG docker $USER $ sudo apt install docker-ce docker-ce-cli containerd.io -y Run the beneath to install it $ sudo apt-get update ![]() So, to install latest and stable version of docker from its official repository. 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. ![]()
0 Comments
Leave a Reply. |