diff --git a/.dockerignore b/.dockerignore index 80cbeb040cf87..55636e790285e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -111,3 +111,7 @@ prime/ # Manpage /man + +Dockerfile +.dockerignore +.github/ diff --git a/.github/labeler.yml b/.github/labeler.yml index 8a5ab26975ea0..99e9d6f0a356c 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -24,7 +24,6 @@ modifies/migrations: modifies/internal: - "Makefile" - "Dockerfile" - - "Dockerfile.rootless" - "docker/**" - "webpack.config.js" - ".eslintrc.yaml" diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index e7039053af9de..5bf817458b03e 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -78,7 +78,6 @@ jobs: docker: - "Dockerfile" - - "Dockerfile.rootless" - "docker/**" - "Makefile" diff --git a/.github/workflows/pull-docker-dryrun.yml b/.github/workflows/pull-docker-dryrun.yml index f74277de671bf..8fe160b83d353 100644 --- a/.github/workflows/pull-docker-dryrun.yml +++ b/.github/workflows/pull-docker-dryrun.yml @@ -11,7 +11,7 @@ jobs: files-changed: uses: ./.github/workflows/files-changed.yml - regular: + docker: if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest @@ -19,17 +19,13 @@ jobs: - uses: docker/setup-buildx-action@v3 - uses: docker/build-push-action@v5 with: + target: gitea + pull: true push: false tags: gitea/gitea:linux-amd64 - - rootless: - if: needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.actions == 'true' - needs: files-changed - runs-on: ubuntu-latest - steps: - - uses: docker/setup-buildx-action@v3 - uses: docker/build-push-action@v5 with: + target: gitea-rootless + pull: true push: false - file: Dockerfile.rootless tags: gitea/gitea:linux-amd64 diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml index ef1e63df2ffc0..8cae8e630e212 100644 --- a/.github/workflows/release-nightly.yml +++ b/.github/workflows/release-nightly.yml @@ -57,17 +57,13 @@ jobs: - name: upload binaries to s3 run: | aws s3 sync dist/release s3://${{ secrets.AWS_S3_BUCKET }}/gitea/${{ steps.clean_name.outputs.branch }} --no-progress - nightly-docker-rootful: + nightly-docker: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # fetch all commits instead of only the last as some branches are long lived and could have many between versions # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v4 - with: - go-version-file: go.mod - check-latest: true - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - name: Get cleaned branch name @@ -80,55 +76,38 @@ jobs: fi REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT" + - name: Get nightly version + run: | + NIGHTLY_VERSION="$(git describe --tags --always | sed 's/-/+/' | sed 's/^v//')" + echo "NIGHTLY_VERSION=${NIGHTLY_VERSION}" >> "${GITHUB_ENV}" - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: fetch go modules - run: make vendor - name: build rootful docker image uses: docker/build-push-action@v5 with: context: . + target: gitea + build-args: | + GITHUB_REF_NAME=${{ env.GITHUB_REF_NAME }} + GITHUB_REF_TYPE=${{ env.GITHUB_REF_TYPE }} + DOCKER_GITEA_VERSION=${{ env.NIGHTLY_VERSION }} platforms: linux/amd64,linux/arm64 + pull: true push: true tags: gitea/gitea:${{ steps.clean_name.outputs.branch }} - nightly-docker-rootless: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: actions/setup-go@v4 - with: - go-version-file: go.mod - check-latest: true - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - name: Get cleaned branch name - id: clean_name - run: | - # if main then say nightly otherwise cleanup name - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - echo "branch=nightly" >> "$GITHUB_OUTPUT" - exit 0 - fi - REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') - echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT" - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: fetch go modules - run: make vendor - name: build rootless docker image uses: docker/build-push-action@v5 with: context: . + target: gitea-rootless + build-args: | + GITHUB_REF_NAME=${{ env.GITHUB_REF_NAME }} + GITHUB_REF_TYPE=${{ env.GITHUB_REF_TYPE }} + DOCKER_GITEA_VERSION=${{ env.NIGHTLY_VERSION }} platforms: linux/amd64,linux/arm64 + pull: true push: true - file: Dockerfile.rootless tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}-rootless diff --git a/.github/workflows/release-tag-rc.yml b/.github/workflows/release-tag-rc.yml index 861179d9c8652..65a44d8dde326 100644 --- a/.github/workflows/release-tag-rc.yml +++ b/.github/workflows/release-tag-rc.yml @@ -61,46 +61,21 @@ jobs: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/* env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - docker-rootful: + docker: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - uses: docker/metadata-action@v5 - id: meta + id: meta-rootful with: images: gitea/gitea # 1.2.3-rc0 tags: | type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build rootful docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - docker-rootless: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - uses: docker/metadata-action@v5 - id: meta + id: meta-rootless with: images: gitea/gitea # each tag below will have the suffix of -rootless @@ -114,12 +89,29 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build rootful docker image + uses: docker/build-push-action@v5 + with: + context: . + target: gitea + build-args: | + GITHUB_REF_NAME=${{ env.GITHUB_REF_NAME }} + GITHUB_REF_TYPE=${{ env.GITHUB_REF_TYPE }} + platforms: linux/amd64,linux/arm64 + pull: true + push: true + tags: ${{ steps.meta-rootful.outputs.tags }} + labels: ${{ steps.meta-rootful.outputs.labels }} - name: build rootless docker image uses: docker/build-push-action@v5 with: context: . + target: gitea-rootless + build-args: | + GITHUB_REF_NAME=${{ env.GITHUB_REF_NAME }} + GITHUB_REF_TYPE=${{ env.GITHUB_REF_TYPE }} platforms: linux/amd64,linux/arm64 + pull: true push: true - file: Dockerfile.rootless - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-rootless.outputs.tags }} + labels: ${{ steps.meta-rootless.outputs.labels }} diff --git a/.github/workflows/release-tag-version.yml b/.github/workflows/release-tag-version.yml index c3fce7e2a7c58..94dffed29efd1 100644 --- a/.github/workflows/release-tag-version.yml +++ b/.github/workflows/release-tag-version.yml @@ -63,17 +63,13 @@ jobs: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --draft --notes-from-tag dist/release/* env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - docker-rootful: + docker: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - uses: docker/metadata-action@v5 - id: meta + id: meta-rootful with: images: gitea/gitea # this will generate tags in the following format: @@ -86,30 +82,8 @@ jobs: type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{version}} - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build rootful docker image - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - docker-rootless: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # fetch all commits instead of only the last as some branches are long lived and could have many between versions - # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 - - run: git fetch --unshallow --quiet --tags --force - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - uses: docker/metadata-action@v5 - id: meta + id: meta-rootless with: images: gitea/gitea # each tag below will have the suffix of -rootless @@ -130,12 +104,29 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build rootful docker image + uses: docker/build-push-action@v5 + with: + context: . + target: gitea + build-args: | + GITHUB_REF_NAME=${{ env.GITHUB_REF_NAME }} + GITHUB_REF_TYPE=${{ env.GITHUB_REF_TYPE }} + platforms: linux/amd64,linux/arm64 + pull: true + push: true + tags: ${{ steps.meta-rootful.outputs.tags }} + labels: ${{ steps.meta-rootful.outputs.labels }} - name: build rootless docker image uses: docker/build-push-action@v5 with: context: . + target: gitea-rootless + build-args: | + GITHUB_REF_NAME=${{ env.GITHUB_REF_NAME }} + GITHUB_REF_TYPE=${{ env.GITHUB_REF_TYPE }} platforms: linux/amd64,linux/arm64 + pull: true push: true - file: Dockerfile.rootless - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-rootless.outputs.tags }} + labels: ${{ steps.meta-rootless.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 5fe8df91268b8..ad1d84828a03e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,75 +1,173 @@ # Build stage -FROM docker.io/library/golang:1.21-alpine3.18 AS build-env +FROM docker.io/library/node:20-alpine3.18 AS build-frontend + +# Build deps +RUN apk --no-cache add build-base git \ + && rm -rf /var/cache/apk/* + +# Setup repo +WORKDIR /usr/src/code.gitea.io/gitea + +COPY Makefile . + +# Download NPM Packages +COPY package.json . +COPY package-lock.json . + +RUN make deps-frontend + +# Copy source files +COPY ./webpack.config.js . +COPY ./assets ./assets +COPY ./public ./public +COPY ./web_src ./web_src + +ARG GITHUB_REF_NAME +ARG GITHUB_REF_TYPE +ARG DOCKER_GITEA_VERSION + +ENV GITHUB_REF_NAME=${GITHUB_REF_NAME:-docker-develop} +ENV GITHUB_REF_TYPE=${GITHUB_REF_TYPE:-branch} +ENV DOCKER_GITEA_VERSION=${DOCKER_GITEA_VERSION:-${GITHUB_REF_NAME}} + +# Build frontend +RUN make clean-all frontend + +# Build stage +FROM docker.io/library/golang:1.21-alpine3.18 AS build-backend ARG GOPROXY ENV GOPROXY ${GOPROXY:-direct} -ARG GITEA_VERSION ARG TAGS="sqlite sqlite_unlock_notify" ENV TAGS "bindata timetzdata $TAGS" ARG CGO_EXTRA_CFLAGS # Build deps -RUN apk --no-cache add \ - build-base \ - git \ - nodejs \ - npm \ - && rm -rf /var/cache/apk/* +RUN apk --no-cache add build-base git \ + && rm -rf /var/cache/apk/* # Setup repo -COPY . ${GOPATH}/src/code.gitea.io/gitea WORKDIR ${GOPATH}/src/code.gitea.io/gitea -# Checkout version if set -RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ - && make clean-all build +COPY Makefile . + +# Download Golang Modules +COPY go.mod . +COPY go.sum . + +RUN make deps-backend + +# Copy source files +COPY ./build ./build +COPY ./cmd ./cmd +COPY ./models ./models +COPY ./modules ./modules +COPY ./options ./options +COPY ./routers ./routers +COPY ./services ./services +COPY ./templates ./templates +COPY ./build.go . +COPY ./main.go . + +# Clean directory +RUN make clean-all + +# Copy frontend build artifacts +COPY --from=build-frontend /usr/src/code.gitea.io/gitea/public ./public + +ARG GITHUB_REF_NAME +ARG GITHUB_REF_TYPE +ARG DOCKER_GITEA_VERSION + +ENV GITHUB_REF_NAME=${GITHUB_REF_NAME:-docker-develop} +ENV GITHUB_REF_TYPE=${GITHUB_REF_TYPE:-branch} +ENV DOCKER_GITEA_VERSION=${DOCKER_GITEA_VERSION:-${GITHUB_REF_NAME}} + +# Build backend +RUN make backend # Begin env-to-ini build +COPY contrib/environment-to-ini/environment-to-ini.go contrib/environment-to-ini/environment-to-ini.go +COPY ./custom ./custom + RUN go build contrib/environment-to-ini/environment-to-ini.go -# Copy local files -COPY docker/root /tmp/local - -# Set permissions -RUN chmod 755 /tmp/local/usr/bin/entrypoint \ - /tmp/local/usr/local/bin/gitea \ - /tmp/local/etc/s6/gitea/* \ - /tmp/local/etc/s6/openssh/* \ - /tmp/local/etc/s6/.s6-svscan/* \ - /go/src/code.gitea.io/gitea/gitea \ - /go/src/code.gitea.io/gitea/environment-to-ini -RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete - -FROM docker.io/library/alpine:3.18 +FROM docker.io/library/alpine:3.18 AS gitea-base LABEL maintainer="maintainers@gitea.io" +RUN apk --no-cache add \ + bash \ + ca-certificates \ + gettext \ + git \ + curl \ + gnupg \ + && rm -rf /var/cache/apk/* + +RUN addgroup -S -g 1000 git + +COPY --chmod=644 ./contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh +COPY --chmod=755 --from=build-backend /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea +COPY --chmod=755 --from=build-backend /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini + +FROM gitea-base AS gitea-rootless + +EXPOSE 2222 3000 + +RUN apk --no-cache add \ + dumb-init \ + && rm -rf /var/cache/apk/* + +RUN adduser \ + -S -H -D \ + -h /var/lib/gitea/git \ + -s /bin/bash \ + -u 1000 \ + -G git \ + git + +RUN mkdir -p /var/lib/gitea /etc/gitea +RUN chown git:git /var/lib/gitea /etc/gitea + +# Copy local files +COPY --chmod=755 docker/rootless / + +# git:git +USER 1000:1000 +ENV GITEA_WORK_DIR /var/lib/gitea +ENV GITEA_CUSTOM /var/lib/gitea/custom +ENV GITEA_TEMP /tmp/gitea +ENV TMPDIR /tmp/gitea + +# TODO add to docs the ability to define the ini to load (useful to test and revert a config) +ENV GITEA_APP_INI /etc/gitea/app.ini +ENV HOME "/var/lib/gitea/git" +VOLUME ["/var/lib/gitea", "/etc/gitea"] +WORKDIR /var/lib/gitea + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"] +CMD [] + +FROM gitea-base AS gitea + EXPOSE 22 3000 RUN apk --no-cache add \ - bash \ - ca-certificates \ - curl \ - gettext \ - git \ - linux-pam \ - openssh \ - s6 \ - sqlite \ - su-exec \ - gnupg \ - && rm -rf /var/cache/apk/* - -RUN addgroup \ - -S -g 1000 \ - git && \ - adduser \ - -S -H -D \ - -h /data/git \ - -s /bin/bash \ - -u 1000 \ - -G git \ - git && \ + linux-pam \ + openssh \ + s6 \ + sqlite \ + su-exec \ + && rm -rf /var/cache/apk/* + +RUN adduser \ + -S -H -D \ + -h /data/git \ + -s /bin/bash \ + -u 1000 \ + -G git \ + git && \ echo "git:*" | chpasswd -e ENV USER git @@ -80,7 +178,4 @@ VOLUME ["/data"] ENTRYPOINT ["/usr/bin/entrypoint"] CMD ["/bin/s6-svscan", "/etc/s6"] -COPY --from=build-env /tmp/local / -COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea -COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini -COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh +COPY --chmod=755 docker/root / diff --git a/Dockerfile.rootless b/Dockerfile.rootless deleted file mode 100644 index 5ea4d2fc75190..0000000000000 --- a/Dockerfile.rootless +++ /dev/null @@ -1,90 +0,0 @@ -# Build stage -FROM docker.io/library/golang:1.21-alpine3.18 AS build-env - -ARG GOPROXY -ENV GOPROXY ${GOPROXY:-direct} - -ARG GITEA_VERSION -ARG TAGS="sqlite sqlite_unlock_notify" -ENV TAGS "bindata timetzdata $TAGS" -ARG CGO_EXTRA_CFLAGS - -#Build deps -RUN apk --no-cache add \ - build-base \ - git \ - nodejs \ - npm \ - && rm -rf /var/cache/apk/* - -# Setup repo -COPY . ${GOPATH}/src/code.gitea.io/gitea -WORKDIR ${GOPATH}/src/code.gitea.io/gitea - -# Checkout version if set -RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ - && make clean-all build - -# Begin env-to-ini build -RUN go build contrib/environment-to-ini/environment-to-ini.go - -# Copy local files -COPY docker/rootless /tmp/local - -# Set permissions -RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \ - /tmp/local/usr/local/bin/docker-setup.sh \ - /tmp/local/usr/local/bin/gitea \ - /go/src/code.gitea.io/gitea/gitea \ - /go/src/code.gitea.io/gitea/environment-to-ini -RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete - -FROM docker.io/library/alpine:3.18 -LABEL maintainer="maintainers@gitea.io" - -EXPOSE 2222 3000 - -RUN apk --no-cache add \ - bash \ - ca-certificates \ - dumb-init \ - gettext \ - git \ - curl \ - gnupg \ - && rm -rf /var/cache/apk/* - -RUN addgroup \ - -S -g 1000 \ - git && \ - adduser \ - -S -H -D \ - -h /var/lib/gitea/git \ - -s /bin/bash \ - -u 1000 \ - -G git \ - git - -RUN mkdir -p /var/lib/gitea /etc/gitea -RUN chown git:git /var/lib/gitea /etc/gitea - -COPY --from=build-env /tmp/local / -COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea -COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini -COPY --from=build-env /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete /etc/profile.d/gitea_bash_autocomplete.sh - -# git:git -USER 1000:1000 -ENV GITEA_WORK_DIR /var/lib/gitea -ENV GITEA_CUSTOM /var/lib/gitea/custom -ENV GITEA_TEMP /tmp/gitea -ENV TMPDIR /tmp/gitea - -# TODO add to docs the ability to define the ini to load (useful to test and revert a config) -ENV GITEA_APP_INI /etc/gitea/app.ini -ENV HOME "/var/lib/gitea/git" -VOLUME ["/var/lib/gitea", "/etc/gitea"] -WORKDIR /var/lib/gitea - -ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"] -CMD [] diff --git a/Makefile b/Makefile index 068dda5f52b17..24d59798e2a7b 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,10 @@ else VERSION ?= main endif + ifneq ($(DOCKER_GITEA_VERSION),) + GITEA_VERSION ?= $(DOCKER_GITEA_VERSION) + endif + STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null) ifneq ($(STORED_VERSION),) GITEA_VERSION ?= $(STORED_VERSION) @@ -975,8 +979,8 @@ generate-manpage: .PHONY: docker docker: - docker build --disable-content-trust=false -t $(DOCKER_REF) . -# support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite sqlite_unlock_notify" . + docker build --disable-content-trust=false -t $(DOCKER_REF) --taget gitea . +# support also build args docker build --build-arg TAGS="bindata sqlite sqlite_unlock_notify" --target gitea . # This endif closes the if at the top of the file endif