Skip to content

Commit

Permalink
feat: add dockerfile for tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
MSevey committed Jul 9, 2024
1 parent b039f19 commit 2c68d08
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Using Debian-based image with Go 1.22
# - go 1.22, required by rollkit
# - Debian for building the wasmd binary
FROM golang:1.22 AS build-env

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
make \
sed \
gcc \
libc-dev \
wget \
bash \
curl \
jq \
ranger \
vim \
libc6 \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set working directory for the build
WORKDIR /src

# Download wasmd repo
RUN git clone https://github.com/CosmWasm/wasmd.git

# Set working directory to wasmd
WORKDIR /src/wasmd

# Update Dependencies
RUN git checkout tags/v0.50.0 && \
go mod edit -replace github.com/cosmos/cosmos-sdk=github.com/rollkit/[email protected] && \
go mod tidy -compat=1.17 && \
go mod download

# Comment out lines 902-904 in app.go as temporary fix until CosmWasm/wasmd#1785 is resolved.
RUN sed -i '902,904 s/^/\/\//' ./app/app.go

# Build the wasmd binary
RUN make install

# Grab in the init.sh script from the docs
RUN wget https://rollkit.dev/cosmwasm/init.sh

# Comment out the wasmd start command lines so that we just initialize the environment
RUN sed -i '/wasmd start/s/^/#/' init.sh

RUN bash init.sh

EXPOSE 36657 36656 9290

# Keep the container running
CMD tail -F /dev/null
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CosmWasm

This repository contains the supporting code for the [CosmWasm tutorial](https://rollkit.dev/tutorials/cosmwasm).

## Overview

The `main` branch contains the Dockerfile and Kurtosis packages for the CosmWasm tutorial.

The `tutorial` branch contains the CosmWasm wasmd code that is used to build the binary for reference.

0 comments on commit 2c68d08

Please sign in to comment.