Skip to content

Commit d1dd3fa

Browse files
GiteaBotsilverwind
andauthored
Fix deprecated Dockerfile ENV format (#31450) (#31452)
Backport #31450 by @silverwind See https://docs.docker.com/reference/build-checks/legacy-key-value-format/. Fixes these warnings seen during the docker build: ``` 4 warnings found (use --debug to expand): - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 5) - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 9) - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 75) - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 76) ``` Introduced in: moby/buildkit#4923 Co-authored-by: silverwind <[email protected]>
1 parent eaeb4d1 commit d1dd3fa

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
33

44
ARG GOPROXY
5-
ENV GOPROXY ${GOPROXY:-direct}
5+
ENV GOPROXY=${GOPROXY:-direct}
66

77
ARG GITEA_VERSION
88
ARG TAGS="sqlite sqlite_unlock_notify"
9-
ENV TAGS "bindata timetzdata $TAGS"
9+
ENV TAGS="bindata timetzdata $TAGS"
1010
ARG CGO_EXTRA_CFLAGS
1111

1212
# Build deps
@@ -72,8 +72,8 @@ RUN addgroup \
7272
git && \
7373
echo "git:*" | chpasswd -e
7474

75-
ENV USER git
76-
ENV GITEA_CUSTOM /data/gitea
75+
ENV USER=git
76+
ENV GITEA_CUSTOM=/data/gitea
7777

7878
VOLUME ["/data"]
7979

Dockerfile.rootless

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
33

44
ARG GOPROXY
5-
ENV GOPROXY ${GOPROXY:-direct}
5+
ENV GOPROXY=${GOPROXY:-direct}
66

77
ARG GITEA_VERSION
88
ARG TAGS="sqlite sqlite_unlock_notify"
9-
ENV TAGS "bindata timetzdata $TAGS"
9+
ENV TAGS="bindata timetzdata $TAGS"
1010
ARG CGO_EXTRA_CFLAGS
1111

1212
#Build deps
@@ -75,14 +75,14 @@ COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_au
7575

7676
# git:git
7777
USER 1000:1000
78-
ENV GITEA_WORK_DIR /var/lib/gitea
79-
ENV GITEA_CUSTOM /var/lib/gitea/custom
80-
ENV GITEA_TEMP /tmp/gitea
81-
ENV TMPDIR /tmp/gitea
78+
ENV GITEA_WORK_DIR=/var/lib/gitea
79+
ENV GITEA_CUSTOM=/var/lib/gitea/custom
80+
ENV GITEA_TEMP=/tmp/gitea
81+
ENV TMPDIR=/tmp/gitea
8282

8383
# TODO add to docs the ability to define the ini to load (useful to test and revert a config)
84-
ENV GITEA_APP_INI /etc/gitea/app.ini
85-
ENV HOME "/var/lib/gitea/git"
84+
ENV GITEA_APP_INI=/etc/gitea/app.ini
85+
ENV HOME="/var/lib/gitea/git"
8686
VOLUME ["/var/lib/gitea", "/etc/gitea"]
8787
WORKDIR /var/lib/gitea
8888

0 commit comments

Comments
 (0)