-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DefiantLabs/danb/basic-docker-file
initial commit
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build and push a Docker image | ||
|
||
on: | ||
push: | ||
tags: | ||
- '**' | ||
branches: | ||
- '**' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: docker-qemu | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: docker-buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: docker-login | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: docker-metadata | ||
id: metadata | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=schedule | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=sha | ||
- name: docker-build-push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM alpine:latest AS alpine | ||
|
||
FROM boxboat/config-merge:latest as config-merge | ||
|
||
FROM alpine:latest | ||
|
||
# Add binaries from config-merge | ||
COPY --from=config-merge /usr/local/config-merge /usr/local/config-merge | ||
COPY --from=config-merge /usr/local/bin/config-merge /usr/local/bin/config-merge | ||
COPY --from=config-merge /usr/local/bin/envsubst /usr/local/bin/envsubst | ||
|
||
# Add dasel | ||
RUN wget -O /usr/local/bin/dasel https://github.com/TomWright/dasel/releases/download/v1.27.1/dasel_linux_amd64 | ||
RUN chmod +x /usr/local/bin/dasel | ||
|
||
# Add system packages | ||
RUN apk add --update nodejs npm curl jq lz4 vim |