Docker-compose

Voir :

podman-compose

docker-compose.yml

version: "3.7" services: memcached: image: memcached:1.5.19-alpine container_name: pm-memcached ports: - "11211" networks: - backend restart: unless-stopped php: image: acme/app1-www:1.01.02 container_name: pm-www volumes: - src:/opt/acme/dir1/app1 - /mnt/data:/mnt/data ports: - "8000" networks: - backend restart: unless-stopped depends_on: - memcached httpd: image: acme/app1-httpd:1.01.02 container_name: pm-httpd volumes: - src:/opt/acme/dir1/app1 - /var/log/app1:/var/log/app1 ports: - "443:443" networks: - backend restart: unless-stopped depends_on: - php networks: backend: # ipam: # driver: default # config: # - subnet: 192.168.10.0/24 volumes: src:

docker-compose.yml

version: "3.7" services: webapp: build: context: . args: - http_proxy=http://192.168.56.1:3128 - https_proxy=http://192.168.56.1:3128 network_mode: "host"

docker-compose.yml

version: "3.7" services: webapp: image: webapp container_name: webapp1 network_mode: "host"
docker-compose build --no-cache docker-compose up

Autres

volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"

Pb

docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object

# mount -o remount,noexec /tmp
# docker-compose
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object

Solution

mkdir /plop chmod 1777 /plop export TMPDIR=/plop docker-compose

Faire un wrapper

mv /usr/local/bin/docker-compose /usr/local/bin/docker-compose-bin

/usr/local/bin/docker-compose

#! /bin/bash DIR=$(dirname "$(realpath "$0")") TMPDIR=/tmp2 if [ ! -d "$TMPDIR" ] then mkdir "$TMPDIR" chmod 1777 "$TMPDIR" fi export TMPDIR ${DIR}/docker-compose-bin "$@"