-
Notifications
You must be signed in to change notification settings - Fork 951
Refactor Dockerfile #8429
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
base: master
Are you sure you want to change the base?
Refactor Dockerfile #8429
Conversation
18489dc
to
7298f44
Compare
008f67c
to
ac0910c
Compare
I'd like to explore ways to not include the .git/ folder (aka placing it in the .dockerignore). Maybe we can add an option to the Makefile that doesn't call |
e264a55
to
c145582
Compare
Nice changes, and with the switch to |
5ade525
to
7f7af77
Compare
@cdecker Adding a non-root Hardcoding the UID inside the Dockerfile creates a fragile assumption and can easily lead to permission issues. Some repos such as mempool do just that, but I don't deem it robust. I have fought with docker user permissions for years, and when there are volumes involved, unless using docker-compose, the best thing is letting the user set the user at runtime via Could not make directory /.lightning: Permission denied |
95545a5
to
d0140cc
Compare
The previous Dockerfile was not cross-compiling rust packages. Cargo was emulating with QEMU instead of cross compiling, despite the efforts as seen by modifying the cargo config.toml. I've now fixed it and it correctly cross compiles (much faster than QEMU), but the Makefile needs a retouch as it is searching the binaries in the wrong folder.
|
b76ec1c
to
fc39b23
Compare
3ce46bb
to
a302995
Compare
all these changelogs only apply to the Docker image. Changelog-Added: added verification of GPG keys for the bitcoin and litecoin tarballs. Changelog-Fixed: fixed compilation on all target architectures; each had their own bugs (poetry, missing packages...). Changelog-Fixed: fixed cargo cross compilation. it was mistakenly using QEMU before. Changelog-Fixed: fixed CPU compatibility bug described in issue 8456 Changelog-Changed: improve build time by 8.8x Changelog-Changed: improve image size by 2.07x more detailed changelog can be found on the PR: ElementsProject#8429
a302995
to
727c056
Compare
all these changelogs only apply to the Docker image. Changelog-Added: added verification of GPG keys for the bitcoin and litecoin tarballs. Changelog-Fixed: fixed compilation on all target architectures; each had their own bugs (poetry, missing packages...). Changelog-Fixed: fixed cargo cross compilation. it was mistakenly using QEMU before. Changelog-Fixed: fixed CPU compatibility bug described in issue 8456 Changelog-Changed: improve build time by 8.8x Changelog-Changed: improve image size by 2.07x more detailed changelog can be found on the PR: ElementsProject#8429
727c056
to
75cdf62
Compare
all these changelogs only apply to the Docker image. Changelog-Added: added verification of GPG keys for the bitcoin and litecoin tarballs. Changelog-Fixed: fixed compilation on all target architectures; each had their own bugs (poetry, missing packages...). Changelog-Fixed: fixed cargo cross compilation. it was mistakenly using QEMU before. Changelog-Fixed: fixed CPU compatibility bug described in issue 8456 Changelog-Changed: improve build time by 8.8x Changelog-Changed: improve image size by 2.07x more detailed changelog can be found on the PR: ElementsProject#8429
75cdf62
to
bcda6b5
Compare
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
#TODO: find a way to avoid copying the .git/ directory (it always invalidates the cache) | ||
COPY .git/ .git/ |
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.
can't we add it in dockerignore?
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.
no. because make
needs it. it calls git describe
to get the tag
This PR refactors the dockerfile according to issue #8409
changes:
ADD
instead ofcurl
SHELL
tee
+ heredocs instead of messy echo'stini
in favor of docker--init
flagmake
and submodules cloningclippy
andrust-doc
componentsbuild time was benchmarked on a 12th Gen Intel(R) Core(TM) i5-1235U and a 20 Mbps connection