Skip to content

Commit

Permalink
Merge pull request #1 from DefiantLabs/danb/basic-docker-file
Browse files Browse the repository at this point in the history
initial commit
  • Loading branch information
danbryan authored Oct 16, 2022
2 parents dc7af82 + 50cdd58 commit bf84713
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/docker.yaml
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 }}
17 changes: 17 additions & 0 deletions Dockerfile
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

0 comments on commit bf84713

Please sign in to comment.