mirror of
https://github.com/gogs/gogs.git
synced 2025-05-27 17:52:21 +00:00
docker: upgrade base images to alpine3.14
(#6675)
This commit is contained in:
parent
5f4e07eb4f
commit
b827a2f342
28
.github/workflows/docker.yml
vendored
28
.github/workflows/docker.yml
vendored
@ -13,10 +13,16 @@ jobs:
|
|||||||
buildx:
|
buildx:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Canel previous runs on main
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||||
|
uses: styfle/cancel-workflow-action@0.9.1
|
||||||
|
with:
|
||||||
|
all_but_latest: true
|
||||||
|
access_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
id: qemu
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@ -32,14 +38,7 @@ jobs:
|
|||||||
echo "Status: ${{ steps.buildx.outputs.status }}"
|
echo "Status: ${{ steps.buildx.outputs.status }}"
|
||||||
echo "Flags: ${{ steps.buildx.outputs.flags }}"
|
echo "Flags: ${{ steps.buildx.outputs.flags }}"
|
||||||
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
|
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
|
||||||
- name: Build images on pull requests
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
@ -51,7 +50,18 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Build and push images on commits to main
|
- name: Get short commit SHA
|
||||||
|
uses: benjlevesque/short-sha@v1.2
|
||||||
|
- name: Build and push images on pull requests
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
gogs/gogs:commit-${{ env.SHA }}
|
||||||
|
- name: Build and push images on main
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM golang:alpine3.12 AS binarybuilder
|
FROM golang:alpine3.14 AS binarybuilder
|
||||||
RUN apk --no-cache --no-progress add --virtual \
|
RUN apk --no-cache --no-progress add --virtual \
|
||||||
build-deps \
|
build-deps \
|
||||||
build-base \
|
build-base \
|
||||||
@ -9,7 +9,7 @@ WORKDIR /gogs.io/gogs
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN make build TAGS="cert pam"
|
RUN make build TAGS="cert pam"
|
||||||
|
|
||||||
FROM alpine:3.12
|
FROM alpine:3.14
|
||||||
RUN if [ `uname -m` == "aarch64" ] ; then \
|
RUN if [ `uname -m` == "aarch64" ] ; then \
|
||||||
export arch="arm64" ; \
|
export arch="arm64" ; \
|
||||||
elif [ `uname -m` == "armv7l" ] ; then \
|
elif [ `uname -m` == "armv7l" ] ; then \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM arm32v7/golang:1.14-alpine3.11 AS binarybuilder
|
FROM arm32v7/golang:1.14-alpine3.14 AS binarybuilder
|
||||||
RUN apk --no-cache --no-progress add --virtual \
|
RUN apk --no-cache --no-progress add --virtual \
|
||||||
build-deps \
|
build-deps \
|
||||||
build-base \
|
build-base \
|
||||||
@ -9,7 +9,7 @@ WORKDIR /gogs.io/gogs
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN make build TAGS="cert pam"
|
RUN make build TAGS="cert pam"
|
||||||
|
|
||||||
FROM arm32v7/alpine:3.12
|
FROM arm32v7/alpine:3.14
|
||||||
RUN wget https://github.com/tianon/gosu/releases/download/1.12/gosu-armhf -O /usr/sbin/gosu \
|
RUN wget https://github.com/tianon/gosu/releases/download/1.12/gosu-armhf -O /usr/sbin/gosu \
|
||||||
&& chmod +x /usr/sbin/gosu \
|
&& chmod +x /usr/sbin/gosu \
|
||||||
&& echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \
|
&& echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user