docker-documentation/images/docker-docker-compose.md

156 wiersze
11 KiB
Markdown
Czysty Zwykły widok Historia

2021-02-12 04:00:03 +00:00
---
title: docker-compose
---
2021-04-16 04:07:22 +00:00
<!-- DO NOT EDIT THIS FILE MANUALLY -->
<!-- Please read the https://github.com/linuxserver/docker-docker-compose/blob/master/.github/CONTRIBUTING.md -->
2020-07-01 20:21:03 +00:00
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
[![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!")
[![Discord](https://img.shields.io/discord/354974912613449730.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://discord.gg/YWrKVTn "realtime support / chat with the community and the team.")
[![Discourse](https://img.shields.io/discourse/https/discourse.linuxserver.io/topics.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=discourse)](https://discourse.linuxserver.io "post on our community forum.")
[![Fleet](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Fleet)](https://fleet.linuxserver.io "an online web interface which displays all of our maintained images.")
[![GitHub](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub&logo=github)](https://github.com/linuxserver "view the source for all of our repositories.")
[![Open Collective](https://img.shields.io/opencollective/all/linuxserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Supporters&logo=open%20collective)](https://opencollective.com/linuxserver "please consider helping us by either donating or contributing to our budget")
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring:
* regular and timely application updates
* easy user mappings (PGID, PUID)
* custom base image with s6 overlay
* weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
* regular security updates
Find us at:
2022-03-15 16:48:37 +00:00
2020-07-01 20:21:03 +00:00
* [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more!
* [Discord](https://discord.gg/YWrKVTn) - realtime support / chat with the community and the team.
* [Discourse](https://discourse.linuxserver.io) - post on our community forum.
* [Fleet](https://fleet.linuxserver.io) - an online web interface which displays all of our maintained images.
* [GitHub](https://github.com/linuxserver) - view the source for all of our repositories.
* [Open Collective](https://opencollective.com/linuxserver) - please consider helping us by either donating or contributing to our budget
# [linuxserver/docker-compose](https://github.com/linuxserver/docker-docker-compose)
2022-03-15 16:48:37 +00:00
[![Scarf.io pulls](https://scarf.sh/installs-badge/linuxserver-ci/linuxserver%2Fdocker-compose?color=94398d&label-color=555555&logo-color=ffffff&style=for-the-badge&package-type=docker)](https://scarf.sh/gateway/linuxserver-ci/docker/linuxserver%2Fdocker-compose)
2020-07-01 20:21:03 +00:00
[![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-docker-compose.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-docker-compose)
2022-03-15 16:48:37 +00:00
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-docker-compose.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github&include_prereleases)](https://github.com/linuxserver/docker-docker-compose/releases)
2020-07-01 20:21:03 +00:00
[![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-docker-compose/packages)
2022-03-15 16:48:37 +00:00
[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/linuxserver.io/docker-docker-compose/container_registry)
[![Quay.io](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Quay.io)](https://quay.io/repository/linuxserver.io/docker-compose)
2020-07-01 20:21:03 +00:00
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/docker-compose.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/docker-compose)
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/docker-compose.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/docker-compose)
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-docker-compose%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-docker-compose/job/master/)
2022-05-05 13:28:38 +00:00
[docker-compose](https://github.com/docker/compose) is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your application's services. Then, using a single command, you create and start all the services from your configuration.
2020-07-01 20:21:03 +00:00
2022-05-05 13:28:38 +00:00
[![docker-compose](https://github.com/docker/compose/raw/master/logo.png)](https://github.com/docker/compose)
2020-07-01 20:21:03 +00:00
## Supported Architectures
2022-03-15 16:48:37 +00:00
We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
2020-07-01 20:21:03 +00:00
2022-03-15 16:48:37 +00:00
Simply pulling `lscr.io/linuxserver/docker-compose:latest` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
2020-07-01 20:21:03 +00:00
The architectures supported by this image are:
2022-03-15 16:48:37 +00:00
| Architecture | Available | Tag |
| :----: | :----: | ---- |
| x86-64 | ✅ | amd64-\<version tag\> |
| arm64 | ✅ | arm64v8-\<version tag\> |
| armhf| ✅ | arm32v7-\<version tag\> |
2020-07-01 20:21:03 +00:00
## Version Tags
2022-03-15 16:48:37 +00:00
This image provides various versions that are available via tags. Please read the descriptions carefully and exercise caution when using unstable or development tags.
| Tag | Available | Description |
| :----: | :----: |--- |
| latest | ✅ | docker-compose v1 releases |
| alpine | ✅ | docker-compose v1 releases with our alpine baseimage |
| v2 | ✅ | docker compose v2 releases |
2020-07-01 20:21:03 +00:00
## Usage
### Docker cli
```
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$PWD:$PWD" \
-w="$PWD" \
2022-03-15 16:48:37 +00:00
lscr.io/linuxserver/docker-compose:latest \
2020-07-01 20:21:03 +00:00
up
```
You can replace the last line with any docker-compose command and argument, which will be passed to docker-compose inside the image.
### Recommended method
We provide a very convenient script that allows the docker-compose container to run as if it was installed natively:
2020-12-18 15:06:51 +00:00
2020-07-01 20:21:03 +00:00
```
sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
```
2020-12-18 15:06:51 +00:00
2020-07-01 20:21:03 +00:00
Running these two commands on your docker host once will let you issue commands such as `docker-compose up -d` and the docker-compose container will do its job behind the scenes.
## Docker Mods
2022-03-15 16:48:37 +00:00
[![Docker Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=docker-compose&query=%24.mods%5B%27docker-compose%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=docker-compose "view available mods for this container.") [![Docker Universal Mods](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=universal&query=%24.mods%5B%27universal%27%5D.mod_count&url=https%3A%2F%2Fraw.githubusercontent.com%2Flinuxserver%2Fdocker-mods%2Fmaster%2Fmod-list.yml)](https://mods.linuxserver.io/?mod=universal "view available universal mods.")
2020-07-01 20:21:03 +00:00
2022-03-15 16:48:37 +00:00
We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.
2020-07-01 20:21:03 +00:00
## Support Info
2022-03-15 16:48:37 +00:00
* Shell access whilst the container is running: `docker exec -it docker-compose /bin/bash`
* To monitor the logs of the container in realtime: `docker logs -f docker-compose`
* container version number
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' docker-compose`
2020-07-01 20:21:03 +00:00
* image version number
2022-03-15 16:48:37 +00:00
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/docker-compose:latest`
2020-07-01 20:21:03 +00:00
## Updating Info
2022-03-15 16:48:37 +00:00
Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (ie. nextcloud, plex), we do not recommend or support updating apps inside the container. Please consult the [Application Setup](#application-setup) section above to see if it is recommended for the image.
Below are the instructions for updating containers:
2020-07-01 20:21:03 +00:00
2022-03-15 16:48:37 +00:00
### Via Docker Run
* Update the image: `docker pull lscr.io/linuxserver/docker-compose:latest`
* You can also remove the old dangling images: `docker image prune`
2020-07-01 20:21:03 +00:00
## Building locally
If you want to make local modifications to these images for development purposes or just to customize the logic:
2022-03-15 16:48:37 +00:00
```bash
2020-07-01 20:21:03 +00:00
git clone https://github.com/linuxserver/docker-docker-compose.git
cd docker-docker-compose
docker build \
--no-cache \
--pull \
2022-03-15 16:48:37 +00:00
-t lscr.io/linuxserver/docker-compose:latest .
2020-07-01 20:21:03 +00:00
```
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
2022-03-15 16:48:37 +00:00
```bash
2020-07-01 20:21:03 +00:00
docker run --rm --privileged multiarch/qemu-user-static:register --reset
```
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
## Versions
2022-03-15 16:48:37 +00:00
* **15.03.22:** - Add v2 branch. Change master to only fetch v1 releases. Change alpine to only fetch v1 releases. Rebase master to focal. Rebase alpine to 3.15.
2020-12-18 15:06:51 +00:00
* **17.12.20:** - Update run.sh with formatting changes.
2020-10-04 19:27:48 +00:00
* **04.10.20:** - Update run.sh with changes from upstream.
2020-08-31 16:48:18 +00:00
* **31.08.20:** - Update tox and virtualenv.
2020-08-01 23:52:58 +00:00
* **31.07.20:** - Add support for global env var `DOCKER_COMPOSE_IMAGE_TAG` in the `run.sh` script.
2020-07-06 15:44:02 +00:00
* **06.07.20:** - Publish docker-compose and docker-cli binaries in Github releases.
2020-07-01 20:21:03 +00:00
* **01.07.20:** - Release alpine based images at `alpine` tag.
* **04.06.20:** - Bump docker-cli to 19.03.8, auto-detect python3 version.
* **19.05.20:** - Initial Release.