Skip to content

Commit

Permalink
tweak docker ci builds to use alpine and not include firecore
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Dec 8, 2023
1 parent 8fb2418 commit 2f30f00
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 113 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ jobs:
contents: read
packages: write

strategy:
matrix:
go-version: [1.21.x]

outputs:
tags: ${{ steps.meta.outputs.tags }}

Expand All @@ -46,19 +42,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Branch name
id: extract_branch
Expand All @@ -67,9 +50,6 @@ jobs:
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=release_train;]$(echo ${GITHUB_REF#refs/heads/release/})"
- name: Build
run: go build -v -ldflags "-X main.version=${{ github.event.ref }}" -o ./fireeth ./cmd/fireeth

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -110,6 +90,8 @@ jobs:
with:
context: .
push: true
build-args: |
VERSION=${{ github.event.ref }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down
79 changes: 0 additions & 79 deletions .github/workflows/poller.yml

This file was deleted.

34 changes: 21 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
FROM ubuntu:20.04
FROM golang:1.21-alpine as build
WORKDIR /app

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get -y install -y \
ca-certificates libssl1.1 vim htop iotop sysstat \
dstat strace lsof curl jq tzdata && \
rm -rf /var/cache/apt /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod download

RUN rm /etc/localtime && ln -snf /usr/share/zoneinfo/America/Montreal /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
COPY . ./

ADD /fireeth /app/fireeth
RUN go build ./cmd/fireeth

####

FROM alpine:edge

ENV PATH "$PATH:/app"

COPY tools/fireeth/motd_generic /etc/motd
COPY tools/fireeth/99-fireeth.sh /etc/profile.d/

# On SSH connection, /root/.bashrc is invoked which invokes '/root/.bash_aliases' if existing,
# so we hijack the file to "execute" our specialized bash script
RUN echo ". /etc/profile.d/99-fireeth.sh" > /root/.bash_aliases

ENV PATH "$PATH:/app"
RUN apk --no-cache add \
ca-certificates htop iotop sysstat \
strace lsof curl jq tzdata

ENTRYPOINT ["/app/fireeth"]
RUN mkdir -p /app/ && curl -Lo /app/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.12/grpc_health_probe-linux-amd64 && chmod +x /app/grpc_health_probe

WORKDIR /app

COPY --from=build /app/fireeth /app/fireeth

ENTRYPOINT ["/app/fireeth"]
2 changes: 1 addition & 1 deletion Dockerfile.bundle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG SF_VERSION=latest
FROM ghcr.io/streamingfast/go-ethereum:$CHAIN_VERSION as chain
FROM ghcr.io/streamingfast/firehose-ethereum:$SF_VERSION

COPY --from=chain /app/geth /app/geth
COPY --from=chain /usr/local/bin/geth /app/geth

COPY tools/fireeth/motd_node_manager /etc/motd
COPY tools/fireeth/scripts/. /usr/local/bin/

0 comments on commit 2f30f00

Please sign in to comment.