Skip to content

Commit

Permalink
Merge pull request #206 from shyim/add-docker
Browse files Browse the repository at this point in the history
Add docker image
  • Loading branch information
fabpot committed Nov 4, 2022
2 parents ace4129 + ae32650 commit 8a46133
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,30 @@ on:
permissions:
contents: write
id-token: write
packages: write

jobs:
releaser:
name: Release
runs-on: ubuntu-latest
env:
# We need to set DOCKER_CLI_EXPERIMENTAL=enabled for the docker manifest commands to work
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

# We need QEMU to use buildx and be able to build ARM Docker images
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Login into Github Docker Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
if: startsWith(github.ref, 'refs/tags/v')

-
name: Set up Go
uses: actions/setup-go@v2
Expand Down
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,35 @@ nfpms:
- rpm
recommends:
- git

dockers:
- image_templates: [ "ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-amd64" ]
goarch: amd64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.source=https://github.com/symfony-cli/symfony-cli"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- image_templates: [ "ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-arm64" ]
goarch: arm64
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.source=https://github.com/symfony-cli/symfony-cli"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.version={{.Version}}"

docker_manifests:
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}
image_templates: &docker_images
- ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-arm64
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:v{{ .Major }}
image_templates: *docker_images
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}
image_templates: *docker_images
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:latest
image_templates: *docker_images
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM scratch as build

COPY --from=composer:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

COPY symfony /usr/local/bin/

FROM scratch

ENTRYPOINT ["/usr/local/bin/symfony"]

COPY --from=build . .

0 comments on commit 8a46133

Please sign in to comment.