-
Notifications
You must be signed in to change notification settings - Fork 17
multi-architecture implementation #14
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ FROM ubuntu:bionic | |
|
|
||
| # To improve : static hash make dynamic build of versions impossible. | ||
| ARG VERSION=1.14.4 | ||
| ARG VERSION_HASH=6266235abe4bcbd41ea57bdf42f11ef89aa69f0386e8c8846d5228af69e7fa13 | ||
| ARG TARGETPLATFORM | ||
|
|
||
| ENV USER=dogecoin | ||
| ENV DATADIR=/${USER}/.dogecoin | ||
|
|
@@ -19,23 +19,28 @@ RUN apt update && apt install -y \ | |
| wget \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Download Dogecoin Core from github releases. | ||
| # Download Dogecoin Core from github releases, | ||
| # manage binary architecture using buildx & TARGETPLATFORM. | ||
| WORKDIR /tmp | ||
|
|
||
| RUN set -ex && \ | ||
| if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then TARGETPLATFORM=x86_64-linux-gnu; fi \ | ||
| && if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then TARGETPLATFORM=aarch64-linux-gnu; fi \ | ||
| && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then TARGETPLATFORM=arm-linux-gnueabihf; fi \ | ||
| && if [ "${TARGETPLATFORM}" = "linux/386" ]; then TARGETPLATFORM=i686-pc-linux-gnu; fi \ | ||
| && wget https://github.com/dogecoin/dogecoin/releases/download/v${VERSION}/dogecoin-${VERSION}-${TARGETPLATFORM}.tar.gz | ||
|
|
||
| # Move downloaded binaries and man pages in the container system. | ||
| # Setuid on binaries with $USER rights, to limit root usage. | ||
| # | ||
| # Security: more secure way than check hash for download, | ||
| # see https://github.com/docker-library/official-images#security | ||
| RUN cd /tmp && \ | ||
| wget https://github.com/dogecoin/dogecoin/releases/download/v${VERSION}/dogecoin-${VERSION}-x86_64-linux-gnu.tar.gz && \ | ||
| echo "${VERSION_HASH} dogecoin-${VERSION}-x86_64-linux-gnu.tar.gz" | sha256sum -c && \ | ||
| tar -xvf dogecoin-${VERSION}-x86_64-linux-gnu.tar.gz --strip-components=1 && \ | ||
| # Setuid on binaries with $USER rights, to prevent | ||
| # root right with `docker exec`. | ||
| RUN tar -xvf dogecoin-${VERSION}-*.tar.gz --strip-components=1 && \ | ||
| cp share/man/man1/*.1 /usr/share/man/man1 && \ | ||
| cp bin/dogecoin* /usr/local/bin && \ | ||
| chown ${USER}:${USER} /usr/local/bin/dogecoin* && \ | ||
| chmod 4555 /usr/local/bin/dogecoin* && \ | ||
| rm -rf /tmp/* | ||
|
|
||
| COPY docker-entrypoint.py /usr/local/bin/docker-entrypoint | ||
| COPY --chmod=500 docker-entrypoint.py /usr/local/bin/docker-entrypoint | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure we want that dependency?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It requires buildkit, which is not enabled by default everywhere. I think we can use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. I would just recommend to use chmod within
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you recommend it? Reduction of build steps or is there more to it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay. Could you please change that then? Let's keep the extra build step until buildkit is the default build process everywhere (currently it's only default on docker-desktop.)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rn, because we are using In any case not a big change, but don't you want to do this edit when/if we're having a solution to enable If we want to go with I like this idea of using
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can do The reason why I am asking to make the separate I have no way to build this without buildkit for this issue, whereas for the first issue I mentioned there is a workaround.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's supersede this design with work from #17 :) |
||
|
|
||
| WORKDIR ${HOME} | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.