-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build docker executable with musl libc.
- Loading branch information
1 parent
e3ff391
commit 1c26588
Showing
5 changed files
with
58 additions
and
3 deletions.
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,46 @@ | ||
FROM alpine:3.10 | ||
|
||
ENV DUB_BRANCH "v1.20.1" | ||
ENV RDMD_BRANCH "v2.091.0" | ||
|
||
RUN apk add --no-cache llvm5-libs g++ binutils-gold clang \ | ||
llvm8-libs llvm8-static llvm8-dev \ | ||
cmake ninja zlib-dev curl-dev curl-static openssl-dev git make | ||
|
||
# build ldc2 ######################################################## | ||
|
||
ADD https://github.com/ldc-developers/ldc/releases/download/v1.13.0/ldc2-1.13.0-alpine-linux-x86_64.tar.xz /ldc-bin.tar.xz | ||
RUN tar xf ldc-bin.tar.xz | ||
|
||
# TODO: use environment variable from travis for LDC version | ||
ADD https://github.com/ldc-developers/ldc/releases/download/v1.21.0/ldc-1.21.0-src.tar.gz /ldc-src.tar.xz | ||
RUN tar xf ldc-src.tar.xz | ||
|
||
RUN mkdir /ldc-1.21.0-src/build \ | ||
&& cd /ldc-1.21.0-src/build \ | ||
&& cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release \ | ||
-DD_COMPILER=/ldc2-1.13.0-alpine-linux-x86_64/bin/ldmd2 \ | ||
&& ninja -j2 \ | ||
&& ninja install | ||
|
||
# build dub ########################################################## | ||
|
||
RUN git clone --single-branch --branch ${DUB_BRANCH} https://github.com/dlang/dub \ | ||
&& cd dub \ | ||
&& ldmd2 -run build.d \ | ||
&& cp bin/dub /usr/local/bin/ | ||
|
||
# build rdmd ######################################################### | ||
|
||
RUN git clone --single-branch --branch ${RDMD_BRANCH} https://github.com/dlang/tools \ | ||
&& cd tools \ | ||
&& sed -i "s|^DMD = .*$|DMD = ldmd2|" posix.mak \ | ||
&& sed -i "s|^INSTALL_DIR = .*$|INSTALL_DIR = $PWD|" posix.mak \ | ||
&& make -f posix.mak install \ | ||
&& cp bin/rdmd /usr/local/bin/ | ||
|
||
|
||
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,5 @@ | ||
#!/bin/sh | ||
set -e -u | ||
|
||
cd /core/ | ||
dub build -c static --compiler=ldc2 |
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
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