Skip to content

Commit

Permalink
use nightly TinyGo: WASI supported version
Browse files Browse the repository at this point in the history
Signed-off-by: mathetake <takeshi@tetrate.io>
  • Loading branch information
mathetake committed Sep 29, 2020
1 parent 4abe3c9 commit 049dd37
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions images/extension-builders/tinygo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@

FROM golang:1.15

ENV TINYGO_VERSION=0.15.0
RUN git clone --recursive -b non-js-wasm https://github.com/mathetake/tinygo tinygo
WORKDIR tinygo
RUN apt-get update && apt-get -y install cmake clang ninja-build
ENV CC=clang
ENV CXX=clang++

RUN wget https://github.com/tinygo-org/tinygo/releases/download/v${TINYGO_VERSION}/tinygo_${TINYGO_VERSION}_amd64.deb
RUN dpkg -i tinygo_${TINYGO_VERSION}_amd64.deb && rm tinygo_${TINYGO_VERSION}_amd64.deb
RUN make llvm-source
RUN make llvm-build
RUN make wasi-libc
RUN make tinygo

FROM golang:1.15

# TODO: use upstream TinyGo after https://github.com/tinygo-org/tinygo/pull/1373 is merged
COPY --from=0 /go/tinygo/build/tinygo /usr/local/bin

ENV GOCACHE=/source/.gocache
ENV GOMODCACHE=/source/.gomodcache
ENV XDG_CACHE_HOME=/source/.cache

ENV TINYGO_SDK_NAME=github.com/tetratelabs/proxy-wasm-go-sdk
ENV TINYGO_SDK_VERSION=v0.0.2
ENV TINYGO_SDK_PATH=${GOMODCACHE}/${TINYGO_SDK_NAME}@${TINYGO_SDK_VERSION}

RUN mkdir -p ${TINYGO_SDK_PATH} && git clone https://${TINYGO_SDK_NAME} -b ${TINYGO_SDK_VERSION} ${TINYGO_SDK_PATH}

COPY ./entrypoint.sh /usr/local/getenvoy/extension/builder/entrypoint.sh
COPY ./tinygo/commands.sh /usr/local/getenvoy/extension/builder/commands.sh
ENTRYPOINT ["/usr/local/getenvoy/extension/builder/entrypoint.sh"]
Expand Down

0 comments on commit 049dd37

Please sign in to comment.