Skip to content

Commit

Permalink
create debian non static docker-image
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Dec 27, 2023
1 parent b92114c commit 97df580
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/docker-debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Docker

on:
push:
branches:
- main
- anmol/docker-debian
tags:
- "v*.*.*"
pull_request:
branches:
- main
workflow_dispatch:
inputs:
tags:
description: "Tags to build and push"
required: true
type: string

permissions:
contents: read
packages: write

jobs:
build-push:
runs-on: ubuntu-latest

env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE: osmosis-labs/meshd

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}
tags: |
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern={{version}},value=v${{ inputs.tags }},enable=${{ inputs.tags != '' }}
flavor: |
latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run go vendor
run: |
cd demo/ && go mod vendor
- name: Publish to GitHub Packages
uses: docker/build-push-action@v4
with:
platforms: linux/amd64 #,linux/arm64 (removing for debugging)
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile.debian
24 changes: 24 additions & 0 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.21-bookworm AS go-builder

RUN apt-get update && \
apt-get install -y ca-certificates wget make git file libc6-dev clang gcc build-essential

WORKDIR /code

# Download dependencies and CosmWasm libwasmvm if found.
ADD demo/go.mod demo/go.sum ./

#ADD https://github.com/CosmWasm/wasmvm/releases/download/v$wasmvm/libwasmvm_muslc.$arch.a /lib/libwasmvm_muslc.$arch.a
## Download
RUN set -eux; \
WASM_VERSION=v$(go list -m github.com/CosmWasm/wasmvm | cut -d" " -f2 | cut -d"v" -f2); \
echo $WASM_VERSION; \
wget -O /lib/libwasmvm_muslc.a https://github.com/CosmWasm/wasmvm/releases/download/${WASM_VERSION}/libwasmvm_muslc.$(uname -m).a

# Copy over code
COPY . /code

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /code/bin/meshd
# then ensure static linking
RUN cd demo/ && LEDGER_ENABLED=false BUILD_TAGS=muslc make build

0 comments on commit 97df580

Please sign in to comment.