8000 Merge pull request #206 from shyim/add-docker · symfony-cli/symfony-cli@8a46133 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a46133

Browse files
authored
Merge pull request #206 from shyim/add-docker
Add docker image
2 parents ace4129 + ae32650 commit 8a46133

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.github/workflows/releaser.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,30 @@ on:
77
permissions:
88
contents: write
99
id-token: write
10+
packages: write
1011

1112
jobs:
1213
releaser:
1314
name: Release
1415
runs-on: ubuntu-latest
16+
env:
17+
# We need to set DOCKER_CLI_EXPERIMENTAL=enable 8000 d for the docker manifest commands to work
18+
DOCKER_CLI_EXPERIMENTAL: "enabled"
1519
steps:
1620
-
1721
name: Checkout
1822
uses: actions/checkout@v2
1923
with:
2024
fetch-depth: 0
25+
26+
# We need QEMU to use buildx and be able to build ARM Docker images
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v2
29+
30+
- name: Login into Github Docker Registry
31+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
32+
if: startsWith(github.ref, 'refs/tags/v')
33+
2134
-
2235
name: Set up Go
2336
uses: actions/setup-go@v2

.goreleaser.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,35 @@ nfpms:
113113
- rpm
114114
recommends:
115115
- git
116+
117+
dockers:
118+
- image_templates: [ "ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-amd64" ]
119+
goarch: amd64
120+
use: buildx
121+
build_flag_templates:
122+
- "--pull"
123+
- "--platform=linux/amd64"
124+
- "--label=org.opencontainers.image.source=https://github.com/symfony-cli/symfony-cli"
125+
- "--label=org.opencontainers.image.created={{.Date}}"
126+
- "--label=org.opencontainers.image.version={{.Version}}"
127+
- image_templates: [ "ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-arm64" ]
128+
goarch: arm64
129+
use: buildx
130+
build_flag_templates:
131+
- "--pull"
132+
- "--platform=linux/arm64"
133+
- "--label=org.opencontainers.image.source=https://github.com/symfony-cli/symfony-cli"
134+
- "--label=org.opencontainers.image.created={{.Date}}"
135+
- "--label=org.opencontainers.image.version={{.Version}}"
136+
137+
docker_manifests:
138+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}
139+
image_templates: &docker_images
140+
- ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-amd64
141+
- ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-arm64
142+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:v{{ .Major }}
143+
image_templates: *docker_images
144+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}
145+
image_templates: *docker_images
146+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:latest
147+
image_templates: *docker_images

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM scratch as build
2+
3+
COPY --from=composer:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
4+
5+
COPY symfony /usr/local/bin/
6+
7+
FROM scratch
8+
9+
ENTRYPOINT ["/usr/local/bin/symfony"]
10+
11+
COPY --from=build . .

0 commit comments

Comments
 (0)
0