From f0a81d224932332de6ee420e3ea3a96455c0f974 Mon Sep 17 00:00:00 2001 From: coutug Date: Mon, 11 Nov 2024 10:53:44 -0500 Subject: [PATCH] rework dockerfile to include build, add feature/parquet as a branch trigger to github action --- .github/workflows/docker.yml | 17 +---------------- Dockerfile | 12 +++++++++++- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 236f491..cd38f9b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,6 +7,7 @@ on: branches: - master - develop + - feature/parquet env: REGISTRY: ghcr.io @@ -38,9 +39,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - - name: Build Binary - run: go build -v -o substreams-sink-files ./cmd/substreams-sink-files - - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: @@ -68,16 +66,3 @@ jobs: tags: ${{ steps.meta.outputs.tags }} # org.opencontainers.image.version will match the tag name labels: ${{ steps.meta.outputs.labels }} - - slack-notifications: - needs: [build] - runs-on: ubuntu-20.04 - steps: - - name: Slack notification - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - uses: Ilshidur/action-slack@2.0.2 - with: - args: | - :done: *${{ github.repository }}* Success building docker images from ${{ github.ref_type }} _${{ github.ref_name }}_ (${{ github.actor }}) :sparkling_heart: ```${{ join(needs.build.outputs.tags, ' ') }}``` - diff --git a/Dockerfile b/Dockerfile index 7b8fcf0..f55f6da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,23 @@ # syntax=docker/dockerfile:1.2 +FROM golang:1.23.3-alpine3.20 AS build + +WORKDIR /build + +COPY . . + +RUN go build -v -o substreams-sink-files ./cmd/substreams-sink-files + FROM ubuntu:20.04 +WORKDIR /app + RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ ca-certificates libssl1.1 vim strace lsof curl jq && \ rm -rf /var/cache/apt /var/lib/apt/lists/* -ADD /substreams-sink-files /app/substreams-sink-files +COPY --from=build /build/substreams-sink-files . ENV PATH "/app:$PATH"