-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Modify Dockerfile for Cosmwasm static linking #250
Conversation
|
||
# Final image | ||
FROM debian:buster-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to use debian:buster-slim here as before.
Because panacea binary is usally used in Ubuntu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback!
I change final image from alpine to ubuntu in Dockerfile.
Thank you :)
Dockerfile
Outdated
# Get 'libwasmvm.so' from wasmvm | ||
RUN git clone -b v0.14.0 https://github.com/CosmWasm/wasmvm.git /src/wasmvm | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.16.2/libwasmvm_muslc.a /lib/libwasmvm_muslc.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be safer to use the wasmvm v0.14.0 (instead of v0.16.2).
The panacea-core imports wasmd v0.17.0 which uses wasmvm v0.14.0.
Dockerfile
Outdated
ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.16.2/libwasmvm_muslc.a /lib/libwasmvm_muslc.a | ||
RUN sha256sum /lib/libwasmvm_muslc.a | grep 0e62296b9f24cf3a05f8513f99cee536c7087079855ea6ffb4f89b35eccdaa66 | ||
|
||
RUN make clean && LEDGER_ENABLED=true BUILD_TAGS=muslc make build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we don't need to set the LEDGER_ENABLED
env var :)
(unlike other chains).
In the Makefile
, we always enable the ledger
build tag.
Line 15 in e46b2d6
build_tags += ledger |
But, as you did, the BUILD_TAGS=muslc
must be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback!
I change wasmvm version and checksum data.
Also I removed LEDGER_ENABLED
env var
Thank you :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Dockerfile
Outdated
RUN set -eux; apk add --no-cache ca-certificates build-base; | ||
|
||
RUN apk add git | ||
RUN apk add linux-headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN apk add linux-headers | |
RUN apk add libusb-dev linux-headers |
Ah. As I know, the libusb-dev
need to be installed, because we always enable the ledger
tag in the Makefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be build without livusb-dev
. Is this cause problems when the actual panacea run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so. I haven't tested it by myself, but referred to https://github.com/CosmWasm/wasmd/blob/9a17505cf8b637942cad78e294aa1377d7f7b2f6/Dockerfile#L11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, I got it. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
congrat on your first PR 👍
Modify Dockerfile for Cosmwasm static linking.
The binary file for panacea `panacead' works well in Linux OS such as ubuntu or alpine.