Skip to content
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

Merged
merged 4 commits into from
Dec 23, 2021

Conversation

inchori
Copy link

@inchori inchori commented Dec 21, 2021

Modify Dockerfile for Cosmwasm static linking.

The binary file for panacea `panacead' works well in Linux OS such as ubuntu or alpine.


# Final image
FROM debian:buster-slim
Copy link
Contributor

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.

Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

@youngjoon-lee youngjoon-lee Dec 22, 2021

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.

build_tags += ledger

But, as you did, the BUILD_TAGS=muslc must be set.

Copy link
Author

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 :)

Copy link
Contributor

@gyuguen gyuguen left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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!

Copy link
Contributor

@youngjoon-lee youngjoon-lee left a 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 👍

@inchori inchori merged commit 6a40efd into master Dec 23, 2021
@inchori inchori deleted the ft/249/wasm-static-linking branch December 23, 2021 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For production, build panacead with the static linking of wasmvm
3 participants