Skip to content

Commit

Permalink
ci: use alpine in dockerfile (#15703)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Apr 6, 2023
1 parent f5993b1 commit b2c8418
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build & Push
# Build & Push builds the simapp docker image on every push to main and
# and pushes the image to https://hub.docker.com/r/interchainio/simapp/tags
# and pushes the image to https://ghcr.io/cosmos/simapp
on:
pull_request:
paths:
Expand All @@ -11,6 +11,12 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
workflow_dispatch:
inputs:
tags:
description: "SDK version (e.g 0.47.1)"
required: true
type: string

permissions:
contents: read
Expand All @@ -37,8 +43,8 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern=latest-{{major}}.{{minor}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern={{version}},value=v${{ inputs.tags }},enable=${{ inputs.tags != '' }}
flavor: |
latest=false
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# Client: (Note the simapp binary always looks at ~/.simapp we can bind to different local storage)
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.simappcli:/root/.simapp simapp simd keys add foo
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.simappcli:/root/.simapp simapp simd keys list
# TODO: demo connecting rest-server (or is this in server now?)
#
# This image is pushed to the GHCR as https://ghcr.io/cosmos/simapp

# bullseye already comes with build dependencies, so we don't need anything extra to install
FROM --platform=$BUILDPLATFORM golang:1.20-bullseye AS build-env
Expand All @@ -35,9 +36,8 @@ ARG TARGETOS TARGETARCH
# install simapp, remove packages
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make build


# Final image, without build artifacts. `/base` already contains openssl, glibc and all required libs to start an app
FROM gcr.io/distroless/base
# Use alpine:3 as a base image
FROM alpine:3

EXPOSE 26656 26657 1317 9090
# Run simd by default, omit entrypoint to ease using container with simcli
Expand Down

0 comments on commit b2c8418

Please sign in to comment.