github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/cmd/wazero/Dockerfile (about)

     1  # This is an example Dockerfile used to show a way to integrate wasm.
     2  FROM golang:1.21-alpine AS build
     3  
     4  RUN apk add --no-cache git
     5  
     6  WORKDIR /build
     7  
     8  # wazero doesn't publish a Docker image or binary, yet, so build on on demand.
     9  RUN git clone --depth 1 https://github.com/wasilibs/wazerox.git \
    10    && (cd wazero; go build -o wazero -ldflags "-w -s" ./cmd/wazero)
    11  
    12  # wazero has no dependencies, so it can run on scratch
    13  FROM scratch
    14  COPY --from=build /build/wazero/wazero /bin/wazero
    15  
    16  ENTRYPOINT ["/bin/wazero", "run", "-env-inherit", "-cachedir=/cache", "-mount=.:/"]