diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index cec47ae..f4126de 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -6,7 +6,7 @@ on: - "v*.*.*" env: - REGISTRY: git.mancheff.com + REGISTRY: 192.168.0.86:3000 IMAGE_NAME: hiyv-demo/hiyv-nginx jobs: @@ -38,15 +38,23 @@ jobs: echo "tags=${image}:${version},${image}:${major_minor},${image}:${major},${image}:${GITHUB_SHA},${image}:latest" } >> "${GITHUB_OUTPUT}" - - name: Log in to the Gitea registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_TOKEN }} + - name: Configure Gitea registry credentials + shell: bash + env: + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + run: | + mkdir -p "${HOME}/.docker" + auth="$(printf '%s:%s' "${REGISTRY_USERNAME}" "${REGISTRY_TOKEN}" | base64 | tr -d '\n')" + printf '{"auths":{"%s":{"auth":"%s"}}}\n' "${REGISTRY}" "${auth}" > "${HOME}/.docker/config.json" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + buildkitd-config-inline: | + [registry."192.168.0.86:3000"] + http = true + insecure = true - name: Build and publish uses: docker/build-push-action@v6 @@ -55,9 +63,10 @@ jobs: push: true build-args: | COMMIT_ID=${{ github.sha }} + NGINX_BASE=${{ env.REGISTRY }}/hiyv-demo/nginx-base:1.28-alpine-amd64 tags: ${{ steps.tags.outputs.tags }} labels: | org.opencontainers.image.version=${{ steps.tags.outputs.version }} org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} + org.opencontainers.image.source=https://git.mancheff.com/${{ github.repository }} platforms: linux/amd64 diff --git a/Dockerfile b/Dockerfile index 98a5cf3..41d980d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM git.mancheff.com/hiyv-demo/nginx-base:1.28-alpine-amd64 +ARG NGINX_BASE=git.mancheff.com/hiyv-demo/nginx-base:1.28-alpine-amd64 +FROM ${NGINX_BASE} ARG COMMIT_ID=unknown diff --git a/README.md b/README.md index 1c022de..3a1ced5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Git commit used to build the published container. ## Run it ```sh -docker run --rm -p 8080:80 git.mancheff.com/hiyv-demo/hiyv-nginx:1.0.2 +docker run --rm -p 8080:80 git.mancheff.com/hiyv-demo/hiyv-nginx:1.0.3 ``` Open . The health endpoint is available at