-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
135 lines (125 loc) · 6.25 KB
/
.travis.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
dist: xenial
addons:
apt:
packages:
- docker-ce
jobs:
include:
- stage: build
name: "build image"
if: (tag IS blank)
sudo: required
services:
- docker
script:
- git clone https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion docker-letsencrypt-nginx-proxy-companion
- cd ./docker-letsencrypt-nginx-proxy-companion
- cp Dockerfile Dockerfile.amd64
- cp Dockerfile Dockerfile.armv7
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker run --privileged linuxkit/binfmt:v0.8
- docker run -d --privileged -p 1337:1337 --name buildkit moby/buildkit:v0.7.2 --addr tcp://0.0.0.0:1337 --oci-worker-platform linux/amd64 --oci-worker-platform linux/arm/v7
- docker cp buildkit:/usr/bin/buildctl .
- export BUILDKIT_HOST=tcp://0.0.0.0:1337
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/arm/v7 \
--frontend-opt filename=./Dockerfile.armv7 \
--exporter image \
--exporter-opt name=docker.io/hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-latest \
--exporter-opt push=false \
--local dockerfile=. \
--local context=.
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/amd64 \
--frontend-opt filename=./Dockerfile.amd64 \
--exporter image \
--exporter-opt name=docker.io/hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-latest \
--exporter-opt push=false \
--local dockerfile=. \
--local context=.
- stage: build
name: "push latest image"
if: (branch = master AND NOT type = pull_request)
sudo: required
services:
- docker
script:
- git clone https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion docker-letsencrypt-nginx-proxy-companion
- cd ./docker-letsencrypt-nginx-proxy-companion
- cp Dockerfile Dockerfile.amd64
- cp Dockerfile Dockerfile.armv7
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker run --privileged linuxkit/binfmt:v0.8
- docker run -d --privileged -p 1337:1337 --name buildkit moby/buildkit:v0.7.2 --addr tcp://0.0.0.0:1337 --oci-worker-platform linux/amd64 --oci-worker-platform linux/arm/v7
- docker cp buildkit:/usr/bin/buildctl .
- export BUILDKIT_HOST=tcp://0.0.0.0:1337
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/arm/v7 \
--frontend-opt filename=./Dockerfile.armv7 \
--exporter image \
--exporter-opt name=docker.io/hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-latest \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/amd64 \
--frontend-opt filename=./Dockerfile.amd64 \
--exporter image \
--exporter-opt name=docker.io/hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-latest \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- export DOCKER_CLI_EXPERIMENTAL=enabled
- |
docker manifest create hackerh/docker-letsencrypt-nginx-proxy-companion:latest \
hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-latest \
hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-latest
- docker manifest annotate hackerh/docker-letsencrypt-nginx-proxy-companion:latest hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-latest --arch amd64
- docker manifest annotate hackerh/docker-letsencrypt-nginx-proxy-companion:latest hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-latest --arch arm --variant v7
- docker manifest push hackerh/docker-letsencrypt-nginx-proxy-companion:latest
- stage: build
name: "push tagged image"
if: (tag IS present)
sudo: required
services:
- docker
script:
- git clone https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion docker-letsencrypt-nginx-proxy-companion
- cd ./docker-letsencrypt-nginx-proxy-companion
- cp Dockerfile Dockerfile.amd64
- cp Dockerfile Dockerfile.armv7
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- docker run --privileged linuxkit/binfmt:v0.8
- docker run -d --privileged -p 1337:1337 --name buildkit moby/buildkit:v0.7.2 --addr tcp://0.0.0.0:1337 --oci-worker-platform linux/amd64 --oci-worker-platform linux/arm/v7
- docker cp buildkit:/usr/bin/buildctl .
- export BUILDKIT_HOST=tcp://0.0.0.0:1337
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/arm/v7 \
--frontend-opt filename=./Dockerfile.armv7 \
--exporter image \
--exporter-opt name=docker.io/hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-"${TRAVIS_TAG}" \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- |
./buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/amd64 \
--frontend-opt filename=./Dockerfile.amd64 \
--exporter image \
--exporter-opt name=docker.io/hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-"${TRAVIS_TAG}" \
--exporter-opt push=true \
--local dockerfile=. \
--local context=.
- export DOCKER_CLI_EXPERIMENTAL=enabled
- |
docker manifest create hackerh/docker-letsencrypt-nginx-proxy-companion:"${TRAVIS_TAG}" \
hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-"${TRAVIS_TAG}" \
hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-"${TRAVIS_TAG}"
- docker manifest annotate hackerh/docker-letsencrypt-nginx-proxy-companion:"${TRAVIS_TAG}" hackerh/docker-letsencrypt-nginx-proxy-companion:amd64-"${TRAVIS_TAG}" --arch amd64
- docker manifest annotate hackerh/docker-letsencrypt-nginx-proxy-companion:"${TRAVIS_TAG}" hackerh/docker-letsencrypt-nginx-proxy-companion:armv7-"${TRAVIS_TAG}" --arch arm --variant v7
- docker manifest push hackerh/docker-letsencrypt-nginx-proxy-companion:"${TRAVIS_TAG}"