Disable CGO when building Docker images

This commit is contained in:
Frédéric Guillot 2023-06-22 20:54:30 -07:00
parent e234b86af6
commit 30288fec8d
3 changed files with 31 additions and 1 deletions

View file

@ -5,8 +5,36 @@ on:
push: push:
tags: tags:
- '*.*.*' - '*.*.*'
pull_request:
branches: [ main ]
jobs: jobs:
docker-images: test-docker-images:
if: github.event.pull_request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Alpine image
uses: docker/build-push-action@v4
with:
context: .
file: ./packaging/docker/alpine/Dockerfile
push: false
tags: ${{ github.repository_owner }}/miniflux:alpine-dev
- name: Test Alpine Docker image
run: docker run --rm ${{ github.repository_owner }}/miniflux:alpine-dev miniflux -i
- name: Build Distroless image
uses: docker/build-push-action@v4
with:
context: .
file: ./packaging/docker/distroless/Dockerfile
push: false
tags: ${{ github.repository_owner }}/miniflux:distroless-dev
- name: Test Distroless Docker image
run: docker run --rm ${{ github.repository_owner }}/miniflux:distroless-dev miniflux -i
publish-docker-images:
if: ${{ ! github.event.pull_request }}
permissions: permissions:
packages: write packages: write
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -1,4 +1,5 @@
FROM golang:alpine AS build FROM golang:alpine AS build
ENV CGO_ENABLED=0
RUN apk add --no-cache --update git RUN apk add --no-cache --update git
ADD . /go/src/app ADD . /go/src/app
WORKDIR /go/src/app WORKDIR /go/src/app

View file

@ -1,4 +1,5 @@
FROM golang:latest AS build FROM golang:latest AS build
ENV CGO_ENABLED=0
ADD . /go/src/app ADD . /go/src/app
WORKDIR /go/src/app WORKDIR /go/src/app
RUN go build \ RUN go build \