-
Notifications
You must be signed in to change notification settings - Fork 48
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
[---] Build docker executable with musl libc. #751
Open
looked-at-me
wants to merge
7
commits into
dlang-tour:master
Choose a base branch
from
looked-at-me:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1c26588
Build docker executable with musl libc.
looked-at-me 30576a9
Change linker with DFLAGS instead
looked-at-me a199ce7
Use packages instead for tools.
looked-at-me 9f07c74
Remove install of gold and remove DFLAGS.
looked-at-me b831ff7
Add static libraries.
looked-at-me 17cc190
Remove dub folder.
looked-at-me 35af2ab
Update ci/Dockerfile
looked-at-me File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM busybox:glibc | ||
FROM busybox | ||
|
||
MAINTAINER "André Stein <[email protected]>" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:3.12 | ||
|
||
RUN apk add --no-cache g++ clang \ | ||
zlib-dev zlib-static curl-dev curl-static openssl openssl-dev openssl-libs-static \ | ||
ldc dub dtools-rdmd | ||
|
||
COPY docker.build.sh /docker.build.sh | ||
RUN chmod +x /docker.build.sh | ||
|
||
ENTRYPOINT [ "/docker.build.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
set -e -u | ||
|
||
cd /core/ | ||
dub build -c static --compiler=ldc2 | ||
|
||
# remove dub folder generated with build | ||
# as it has root permissions from docker in the build folder | ||
rm -rf ./.dub/ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ dub --compiler=${DC} -- --sanitycheck | |
|
||
# Compile to static binary with ldc | ||
if [[ "${DC}" == "ldc2" ]]; then | ||
dub build -c static --compiler=${DC} | ||
docker build -t dlangtour_build ./ci/ | ||
docker run --rm -v `pwd`:/core/ -ti dlangtour_build | ||
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 the interactive run ? 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. Copied from the docker run below. |
||
|
||
docker build -t dlangtour_test_image ./ | ||
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -ti dlangtour_test_image --wait-until-pulled --sanitycheck | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why the
rm
inside of the docker image ? It doesn't make much sense to me.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.
docker is run with a root user, the folder is generated inside the build folder it is connected to. Without this the remove outside would need root access, which it doesn't have.