top of page

How To: Docker: Install Docker Compose

Updated: Jul 21, 2023

Installing Docker Compose


sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version

Setting Up a docker-compose.yml File


Create a web server environment using the official Nginx image from Docker Hub, the public Docker registry. This containerized environment will serve a single static HTML file.

Start off by creating a new directory in your home folder, and then moving into it:

~/compose-demo/app/index.html
~/compose-demo/docker-compose.yml

docker-compose.yml

version: '3.7'
services:
    web:
        image: nginx:alpine
        ports:
            - "8000:80"
        volumes:
            - ./app:/usr/share/nginx/html

Running Docker Compose


To start up Docker Compose environment

docker-compose up -d

To verify that the container is active, you can run:

docker-compose ps

Enable Docker

sudo systemctl enable docker.service

Reference:


Recent Posts

See All
How to Samba on Ubuntu Server

Install sudo apt install samba -y Verfiy Installation systemctl status smbd Configure sudo nano /etc/samba/smb.conf Create symbolic to...

 
 
 

Comments


Contact Me

Tel: 678-642-8051

cspeed@jcsassoc.com

  • Google+ Long Shadow
  • LinkedIn Long Shadow
  • Facebook Social Icon
  • Twitter Long Shadow

© 2005 by Christopher Speed

Your details were sent successfully!

bottom of page