add libwasmvm and common libraries in fly image (#84)

This commit is contained in:
ftocal 2023-01-24 09:45:07 -03:00 committed by GitHub
parent f4f543fc95
commit 11e1718317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -6,7 +6,10 @@ WORKDIR /app
COPY . . COPY . .
# Build the Go app # Build the Go app
RUN CGO_ENABLED=1 GOOS=linux go build -o "./fly" main.go RUN CGO_ENABLED=1 GOOS=linux go build -o "./fly" main.go && \
go get github.com/CosmWasm/wasmvm@v1.0.0 && \
cp /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/libwasmvm.x86_64.so /usr/lib/
############################ ############################
# STEP 2 build a small image # STEP 2 build a small image
@ -14,7 +17,12 @@ RUN CGO_ENABLED=1 GOOS=linux go build -o "./fly" main.go
FROM alpine FROM alpine
#Copy certificates #Copy certificates
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy our static executable. #Copy libraries
COPY --from=build /lib/* /lib/
COPY --from=build /lib64/* /lib64/
COPY --from=build /usr/lib/libwasmvm.x86_64.so /usr/lib/
#Copy our static executable.
COPY --from=build "/app/fly" "/fly" COPY --from=build "/app/fly" "/fly"
# Run the binary. # Run the binary.
ENTRYPOINT ["/fly"] ENTRYPOINT ["/fly"]