From e9542729a78adb43579f0a5b1719566df9da441a Mon Sep 17 00:00:00 2001 From: Erik Martin-Dorel Date: Tue, 9 Sep 2025 10:08:07 +0200 Subject: [PATCH] style: Address warnings in Dockerfiles and GHA workflows --- .github/workflows/deploy-master.yml | 6 +++--- .github/workflows/release.yml | 12 ++++++------ Dockerfile | 10 +++++----- Dockerfile.test-client | 8 ++++---- Dockerfile.test-server | 10 +++++----- ci/docker-emacs-learn-ocaml-client/Dockerfile | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy-master.yml b/.github/workflows/deploy-master.yml index e766774d4..799a3ba2e 100644 --- a/.github/workflows/deploy-master.yml +++ b/.github/workflows/deploy-master.yml @@ -32,7 +32,7 @@ jobs: - name: Prepare id: prep run: | - echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Push to Docker Hub # cf. https://github.com/docker/build-push-action#customizing # and https://github.com/docker/build-push-action/pull/119 @@ -77,7 +77,7 @@ jobs: - name: Prepare id: prep run: | - echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Push to Docker Hub # cf. https://github.com/docker/build-push-action#customizing # and https://github.com/docker/build-push-action/pull/119 @@ -125,7 +125,7 @@ jobs: - name: Prepare id: prep run: | - echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Push to Docker Hub # cf. https://github.com/docker/build-push-action#customizing # and https://github.com/docker/build-push-action/pull/119 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37e60650d..6ba398aa8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,7 +97,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get tag name - run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "::set-output name=tag::${tag#v}" + run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "tag=${tag#v}" >> $GITHUB_OUTPUT id: tag - name: Check out the repo uses: actions/checkout@v4 @@ -118,7 +118,7 @@ jobs: - name: Prepare id: prep run: | - echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Push to Docker Hub # cf. https://github.com/docker/build-push-action#customizing # and https://github.com/docker/build-push-action/pull/119 @@ -148,7 +148,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get tag name - run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "::set-output name=tag::${tag#v}" + run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "tag=${tag#v}" >> $GITHUB_OUTPUT id: tag - name: Check out the repo uses: actions/checkout@v4 @@ -169,7 +169,7 @@ jobs: - name: Prepare id: prep run: | - echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Push to Docker Hub # cf. https://github.com/docker/build-push-action#customizing # and https://github.com/docker/build-push-action/pull/119 @@ -203,7 +203,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get tag name - run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "::set-output name=tag::${tag#v}" + run: tag="${{ needs.release-please.outputs.tag_name }}"; echo "tag=${tag#v}" >> $GITHUB_OUTPUT id: tag - name: Check out the repo uses: actions/checkout@v4 @@ -224,7 +224,7 @@ jobs: - name: Prepare id: prep run: | - echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')" + echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Push to Docker Hub # cf. https://github.com/docker/build-push-action#customizing # and https://github.com/docker/build-push-action/pull/119 diff --git a/Dockerfile b/Dockerfile index fb44dd51a..e3b28a5a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ocaml/opam:alpine-3.20-ocaml-5.1 as compilation +FROM ocaml/opam:alpine-3.20-ocaml-5.1 AS compilation LABEL Description="learn-ocaml building" Vendor="OCamlPro" WORKDIR /home/opam/learn-ocaml @@ -6,7 +6,7 @@ WORKDIR /home/opam/learn-ocaml COPY learn-ocaml.opam learn-ocaml.opam.locked learn-ocaml-client.opam learn-ocaml-client.opam.locked ./ RUN sudo chown -R opam:nogroup . -ENV OPAMYES true +ENV OPAMYES=true RUN echo 'archive-mirrors: [ "https://opam.ocaml.org/cache" ]' >> ~/.opam/config \ && opam repository set-url default http://opam.ocaml.org \ && opam switch 5.1 \ @@ -23,12 +23,12 @@ COPY dune-project dune-project COPY dune dune RUN sudo chown -R opam:nogroup . -ENV OPAMVERBOSE 1 +ENV OPAMVERBOSE=1 RUN cat /proc/cpuinfo /proc/meminfo RUN opam install . --destdir /home/opam/install-prefix --locked -FROM alpine:3.20 as client +FROM alpine:3.20 AS client RUN apk update \ && apk add ncurses-libs libev dumb-init libssl3 libcrypto3 \ @@ -45,7 +45,7 @@ COPY --from=compilation /home/opam/install-prefix/bin/learn-ocaml-client /usr/bi ENTRYPOINT ["dumb-init","/usr/bin/learn-ocaml-client"] -FROM alpine:3.20 as program +FROM alpine:3.20 AS program RUN apk update \ && apk add ncurses-libs libev dumb-init git openssl lsof \ diff --git a/Dockerfile.test-client b/Dockerfile.test-client index 82da27115..33bf16c7a 100644 --- a/Dockerfile.test-client +++ b/Dockerfile.test-client @@ -1,7 +1,7 @@ # This Dockerfile is useful for testing purposes # to ensure learn-ocaml-client can be built alone from learn-ocaml-client.opam -FROM ocaml/opam:alpine-3.20-ocaml-5.1 as compilation +FROM ocaml/opam:alpine-3.20-ocaml-5.1 AS compilation LABEL Description="learn-ocaml building" Vendor="OCamlPro" WORKDIR /home/opam/learn-ocaml @@ -10,7 +10,7 @@ WORKDIR /home/opam/learn-ocaml COPY learn-ocaml-client.opam learn-ocaml.opam ./ RUN sudo chown -R opam:nogroup . -ENV OPAMYES true +ENV OPAMYES=true RUN echo 'archive-mirrors: [ "https://opam.ocaml.org/cache" ]' >> ~/.opam/config \ && opam repository set-url default http://opam.ocaml.org \ && opam switch 5.1 \ @@ -28,13 +28,13 @@ COPY dune-project dune-project COPY dune dune RUN sudo chown -R opam:nogroup . -ENV OPAMVERBOSE 1 +ENV OPAMVERBOSE=1 RUN opam install learn-ocaml-client --destdir /home/opam/install-prefix \ && ls -l /home/opam/install-prefix/bin/learn-ocaml-client -FROM alpine:3.20 as client +FROM alpine:3.20 AS client ARG BUILD_DATE ARG VCS_BRANCH diff --git a/Dockerfile.test-server b/Dockerfile.test-server index 759c3224c..badfe0ded 100644 --- a/Dockerfile.test-server +++ b/Dockerfile.test-server @@ -1,7 +1,7 @@ # This Dockerfile is useful for testing purposes # to ensure learn-ocaml can be built alone from learn-ocaml.opam -FROM ocaml/opam:alpine-3.20-ocaml-5.1 as compilation +FROM ocaml/opam:alpine-3.20-ocaml-5.1 AS compilation LABEL Description="learn-ocaml building" Vendor="OCamlPro" WORKDIR /home/opam/learn-ocaml @@ -10,7 +10,7 @@ WORKDIR /home/opam/learn-ocaml COPY learn-ocaml.opam learn-ocaml-client.opam ./ RUN sudo chown -R opam:nogroup . -ENV OPAMYES true +ENV OPAMYES=true RUN echo 'archive-mirrors: [ "https://opam.ocaml.org/cache" ]' >> ~/.opam/config \ && opam repository set-url default http://opam.ocaml.org \ && opam switch 5.1 \ @@ -28,16 +28,16 @@ COPY dune-project dune-project COPY dune dune RUN sudo chown -R opam:nogroup . -ENV OPAMVERBOSE 1 +ENV OPAMVERBOSE=1 # Run "make detect-libs" -ENV OPAMWITHTEST 1 +ENV OPAMWITHTEST=1 RUN opam install learn-ocaml --destdir /home/opam/install-prefix \ && ls -l /home/opam/install-prefix/bin/learn-ocaml -FROM alpine:3.20 as program +FROM alpine:3.20 AS program ARG BUILD_DATE ARG VCS_BRANCH diff --git a/ci/docker-emacs-learn-ocaml-client/Dockerfile b/ci/docker-emacs-learn-ocaml-client/Dockerfile index 807ae1446..5d826e46f 100644 --- a/ci/docker-emacs-learn-ocaml-client/Dockerfile +++ b/ci/docker-emacs-learn-ocaml-client/Dockerfile @@ -14,11 +14,11 @@ RUN apk add --no-cache \ && mkdir -p -v bin \ && chown -v learn-ocaml:learn-ocaml bin -ENV PATH /home/learn-ocaml/bin:${PATH} +ENV PATH="/home/learn-ocaml/bin:${PATH}" -ENV LANG C.UTF-8 -# ENV LC_ALL C.UTF-8 -# ENV LANGUAGE en_US:en +ENV LANG="C.UTF-8" +# ENV LC_ALL="C.UTF-8" +# ENV LANGUAGE="en_US:en" COPY --chown=learn-ocaml:learn-ocaml .emacs .emacs