-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
106 lines (104 loc) · 3.29 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# To build all the docker images:
# docker-compose build
# or a specific one:
# docker-compose build ${SERVICE_NAME}
#
# export SERVICE_NAME=ubuntu
#
# To extract the cargo cache from the container:
# docker-compose run --rm ${SERVICE_NAME} cp docker_cargo_cache.tar.gz artifacts/
#
# To get a shell inside the container:
# docker-compose run --rm ${SERVICE_NAME}
#
# NOTE: The 'artifacts' directory of each container is mounted so one can copy
# files from inside a container.
#
# Install a toolchain and transfer it back:
# docker-compose up -d ${SERVICE_NAME}
# docker-compose exec ${SERVICE_NAME} mkdir .hygeia/cache
# docker-compose exec ${SERVICE_NAME} hygeia install ~3.7 --extra
# docker-compose exec ${SERVICE_NAME} sh -c 'cp -r ${HOME}/.hygeia/installed artifacts/'
#
# Delete **all** containers (loosing any built toolchains)
# docker-compose down
#
# Without docker-compose:
# Build the image:
# export OS_NAME="ubuntu"
# export OS_VERSION="16.04"
# export RUST_VERSION="1.51.0"
# docker build --build-arg OS_NAME=${OS_NAME} --build-arg OS_VERSION=${OS_VERSION} --build-arg DOCKER_GID=`id --group` --build-arg DOCKER_UID=`id --user` --build-arg RUST_VERSION=${RUST_VERSION} --tag hygeia_${OS_NAME} --file docker/${OS_NAME}/Dockerfile .
# docker run --rm --detach --name hygeia_${OS_NAME} --volume `pwd`/docker/${OS_NAME}/artifacts:/home/hygeia/artifacts hygeia_${OS_NAME} sleep 9999999
# docker exec -it hygeia_${OS_NAME} hygeia install ~3.7 --extra
# docker exec -it hygeia_${OS_NAME} sh -c 'cp -r ${HOME}/.hygeia/installed artifacts/'
# docker stop hygeia_${OS_NAME}
# docker kill hygeia_${OS_NAME}
version: "3.7"
services:
ubuntu:
image: hygeia_ubuntu
build:
context: .
dockerfile: docker/ubuntu/Dockerfile
args:
OS_NAME: "ubuntu"
OS_VERSION: "16.04"
RUST_VERSION: "1.51.0"
environment:
RUST_LOG: hygeia=debug
stdin_open: true
tty: true
volumes:
- ./docker/ubuntu/artifacts:/home/hygeia/artifacts
- .:/home/hygeia/hygeia.git
debian_sid:
image: hygeia_debian_sid
build:
context: .
dockerfile: docker/debian/sid/Dockerfile
args:
OS_NAME: "debian"
OS_VERSION: "sid-20191224"
RUST_VERSION: "1.51.0"
environment:
RUST_LOG: hygeia=debug
stdin_open: true
tty: true
volumes:
- ./docker/debian/sid/artifacts:/home/hygeia/artifacts
- .:/home/hygeia/hygeia.git
fedora:
image: hygeia_fedora
build:
context: .
dockerfile: docker/fedora/Dockerfile
args:
OS_NAME: "fedora"
OS_VERSION: "31"
RUST_VERSION: "1.51.0"
environment:
RUST_LOG: hygeia=debug
stdin_open: true
tty: true
volumes:
- ./docker/fedora/artifacts:/home/hygeia/artifacts
- .:/home/hygeia/hygeia.git
alpine:
image: hygeia_alpine
build:
context: .
dockerfile: docker/alpine/Dockerfile
args:
OS_NAME: "alpine"
OS_VERSION: "3.10.3"
RUST_VERSION: "1.51.0"
# See https://github.com/rust-lang/rust/issues/59302
RUSTFLAGS: -C target-feature=-crt-static
environment:
RUST_LOG: hygeia=debug
stdin_open: true
tty: true
volumes:
- ./docker/alpine/artifacts:/home/hygeia/artifacts
- .:/home/hygeia/hygeia.git