Skip to content

Commit ce8c006

Browse files
authored
ci(docker): Replace LABEL Dockerfile commands with labels: (GHA) (#551)
This cleanup patch sets labels in a more uniform way, and contributes to earn several (small) layers in the resulting images. Related: docker/build-push-action#863 Close #545
1 parent 1584a08 commit ce8c006

File tree

3 files changed

+30
-16
lines changed

3 files changed

+30
-16
lines changed

.github/workflows/deploy-master.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ jobs:
3939
push: true
4040
tags: "ocamlsf/learn-ocaml:master"
4141
labels: |
42+
org.opencontainers.image.title=learn-ocaml
43+
org.opencontainers.image.description=learn-ocaml app manager
44+
org.opencontainers.image.url=https://ocaml-sf.org/
45+
org.opencontainers.image.vendor=The OCaml Software Foundation
4246
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
43-
org.opencontainers.image.source=${{ github.repositoryUrl }}
47+
org.opencontainers.image.source=${{ github.server_url }}${{ github.repository }}
4448
org.opencontainers.image.version=master
4549
org.opencontainers.image.revision=${{ github.sha }}
4650
push_client:
@@ -76,8 +80,12 @@ jobs:
7680
target: client
7781
tags: "ocamlsf/learn-ocaml-client:master"
7882
labels: |
83+
org.opencontainers.image.title=learn-ocaml-client
84+
org.opencontainers.image.description=learn-ocaml command-line client
85+
org.opencontainers.image.url=https://ocaml-sf.org/
86+
org.opencontainers.image.vendor=The OCaml Software Foundation
7987
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
80-
org.opencontainers.image.source=${{ github.repositoryUrl }}
88+
org.opencontainers.image.source=${{ github.server_url }}${{ github.repository }}
8189
org.opencontainers.image.version=master
8290
org.opencontainers.image.revision=${{ github.sha }}
8391
push_emacs_client:
@@ -116,7 +124,11 @@ jobs:
116124
version=master
117125
tags: "ocamlsf/emacs-learn-ocaml-client:master"
118126
labels: |
127+
org.opencontainers.image.title=learn-ocaml-client with emacs
128+
org.opencontainers.image.description=learn-ocaml command-line client with emacs
129+
org.opencontainers.image.url=https://ocaml-sf.org/
130+
org.opencontainers.image.vendor=The OCaml Software Foundation
119131
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
120-
org.opencontainers.image.source=${{ github.repositoryUrl }}
132+
org.opencontainers.image.source=${{ github.server_url }}${{ github.repository }}
121133
org.opencontainers.image.version=master
122134
org.opencontainers.image.revision=${{ github.sha }}

.github/workflows/release.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,12 @@ jobs:
160160
ocamlsf/learn-ocaml:latest
161161
ocamlsf/learn-ocaml:${{ steps.tag.outputs.tag }}
162162
labels: |
163+
org.opencontainers.image.title=learn-ocaml
164+
org.opencontainers.image.description=learn-ocaml app manager
165+
org.opencontainers.image.url=https://ocaml-sf.org/
166+
org.opencontainers.image.vendor=The OCaml Software Foundation
163167
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
164-
org.opencontainers.image.source=${{ github.repositoryUrl }}
168+
org.opencontainers.image.source=${{ github.server_url }}${{ github.repository }}
165169
org.opencontainers.image.version=${{ steps.tag.outputs.tag }}
166170
org.opencontainers.image.revision=${{ github.sha }}
167171
push_client:
@@ -203,8 +207,12 @@ jobs:
203207
ocamlsf/learn-ocaml-client:latest
204208
ocamlsf/learn-ocaml-client:${{ steps.tag.outputs.tag }}
205209
labels: |
210+
org.opencontainers.image.title=learn-ocaml-client
211+
org.opencontainers.image.description=learn-ocaml command-line client
212+
org.opencontainers.image.url=https://ocaml-sf.org/
213+
org.opencontainers.image.vendor=The OCaml Software Foundation
206214
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
207-
org.opencontainers.image.source=${{ github.repositoryUrl }}
215+
org.opencontainers.image.source=${{ github.server_url }}${{ github.repository }}
208216
org.opencontainers.image.version=${{ steps.tag.outputs.tag }}
209217
org.opencontainers.image.revision=${{ github.sha }}
210218
push_emacs_client:
@@ -250,7 +258,11 @@ jobs:
250258
ocamlsf/emacs-learn-ocaml-client:latest
251259
ocamlsf/emacs-learn-ocaml-client:${{ steps.tag.outputs.tag }}
252260
labels: |
261+
org.opencontainers.image.title=learn-ocaml-client with emacs
262+
org.opencontainers.image.description=learn-ocaml command-line client with emacs
263+
org.opencontainers.image.url=https://ocaml-sf.org/
264+
org.opencontainers.image.vendor=The OCaml Software Foundation
253265
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
254-
org.opencontainers.image.source=${{ github.repositoryUrl }}
266+
org.opencontainers.image.source=${{ github.server_url }}${{ github.repository }}
255267
org.opencontainers.image.version=${{ steps.tag.outputs.tag }}
256268
org.opencontainers.image.revision=${{ github.sha }}

Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ COPY --from=compilation /home/opam/install-prefix/bin/learn-ocaml-client /usr/bi
4444

4545
ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml-client"]
4646

47-
LABEL org.opencontainers.image.title="learn-ocaml-client"
48-
LABEL org.opencontainers.image.description="learn-ocaml command-line client"
49-
LABEL org.opencontainers.image.url="https://ocaml-sf.org/"
50-
LABEL org.opencontainers.image.vendor="The OCaml Software Foundation"
51-
5247

5348
FROM alpine:3.13 as program
5449

@@ -74,8 +69,3 @@ COPY --from=compilation "$opam_switch/lib/ocaml" "$opam_switch/lib/ocaml/"
7469

7570
ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml","--sync-dir=/sync","--repo=/repository"]
7671
CMD ["build","serve"]
77-
78-
LABEL org.opencontainers.image.title="learn-ocaml"
79-
LABEL org.opencontainers.image.description="learn-ocaml app manager"
80-
LABEL org.opencontainers.image.url="https://ocaml-sf.org/"
81-
LABEL org.opencontainers.image.vendor="The OCaml Software Foundation"

0 commit comments

Comments
 (0)