loadinteractive.wiafe.co

 
1/25/2022

Docker Compose Curl

49

Docker compose is an useful tool for managing multiple docker containers. It helps us to launch, update and build a group of docker containers with single commands. In case of multi container application, docker compose helped us to manage it easier.

  1. Docker Compose Curl Tutorial
  2. Docker Compose Curling Irons

Install docker Install docker-compose docker update cleanup stopped container cleanup no-used volumes cleanup images Change Docker Dir Bash Completion Zsh Completion Kill process in docker container tomcat docker daemon config tar backup & restore colorful bash. Step 3: Download the Latest Docker Version. With the system updated and curl available for use, you can download and install Docker Compose. There is no installation script once the package is locally available, it is automatically installed. Install Compose on Linux systems. On Linux, you can download the Docker Compose binary from the Compose repository release page on GitHub.Follow the instructions from the link, which involve running the curl command in your terminal to download the binaries. Nov 19, 2019 curl is installed on the system if the output displays the message curl: try 'curl -help' or 'curl -manual' for more information. If you see curl: command not found, you will need to install it before setting up Docker Compose.

This tutorial helps you to install Docker compose on a Ubuntu 20.04 LTS Linux system.

Prerequisites

Compose
  • A system running Ubuntu 20.04.
  • Pre-installed Docker service on Ubuntu 20.04.
  • Terminal access with sudo privileged account.
Docker Compose Curl

Install Docker Compose on Ubuntu

Docker compose binary is available on official Github release. Use curl command line tool to download docker compose binary and place under the PATH environment to make it available globally.

Docker Compose Curl Tutorial

First, make sure you have latest curl binary installed on your system.

Now, confirm the latest docker-compsoe binary version on Github releases page. At the time of this writing this tutorial, the current stable version is 1.29.2.

Docker Compose Curl

Docker Compose Curling Irons

Docker compose curl machine

The following command will download the docker-compose binary version 1.29.2 and save this file at /usr/local/bin/docker-compose.

Make the binary docker-compose file executable

Curling

Verify the the docker-compose version by running the followign command.

Output:

Run a Docker Compose Example

At this stage Docker compose have been configured on your Ubuntu system.

  1. First of all, create a directory, which will contain all the files related to this example.
  2. Now, create a html directory. We will map this directory as document root of web server running under the Docker container
  3. Now create a index.html file under html file.
  4. Next, create the most important configuration file docker-compose.yml. This is the file contains all settings used by the docker-compose. Basis of this file docker-compose setup the images, network and containers etc.

    I will discuss this in parts for the better understanding. Edit file in a text editor:

    Add the following content to file.

    The above content shows that we are using latest version of docker compose version 3.

    Next, we defined a service “web” under sevices section. This will launch a docker container using pre-build “php:8.0-apache” AMI. The “html” directory in current folder will be mounted to containers /var/www/html directory.

    Keep your file in editing mode.

  5. Next add a MySQL database container in docker compose file.

    You can change the MySQL versions and access credentials. We have also updated web container configuration to link with database. This will allow web container to access database directly.

    Keep your file in editing mode…

  6. Optional but helpful to add phpmyadmin docker container. This will will help you to access database and its users.

    After adding the phpmyadmin, your docker-compose.yml look like below:

    Save you file and close it.

  7. Next, run the following command to pull all the images on your system.
  8. Next run the build command to create docker images. For this example, you can skip this command as we are using pre build images only.
  9. finally, run the docker-compose up command. Use “-d” option to deamonize container to keep running.
  10. The web server container is listening on port 8080, which we have bind with containers port 80. Access your host machine ip address on port 8080. You will see the index.html created under html directory.


    To make change just update html directory content and refresh page.

Conclusion

This tutorial helped you to install and use docker-compose on Ubuntu systems. The above instructions can be used on Ubuntu 16.04 LTS and above systems.

  • Recent Posts

    • Mac Os Sierra Installation Stuck
    • The Copy Of The Install Macos Catalina Application Is Damaged
    • Macos Big Sur App Store
    • Google Chrome Macbook Download
    • Download Os X Catalina To Usb

loadinteractive.wiafe.co – 2021