diff --git a/Dockerfile b/Dockerfile index 3177928..e235ca2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine RUN apk add --no-cache \ - wget autoconf automake make gcc perl git \ + wget autoconf automake make gcc g++ perl git \ llvm clang musl musl-dev \ ldc ldc-static dub \ zlib zlib-dev zlib-static \ @@ -20,6 +20,7 @@ RUN tar -xf v$DEFLATE_VER.tar.gz WORKDIR libdeflate-$DEFLATE_VER RUN make install -j 8 CFLAGS="-fPIC -ffreestanding -DFREESTANDING" WORKDIR /home/ +RUN rm -r libdeflate-$DEFLATE_VER # build openssl ENV SSL_VER=3.0.0 @@ -30,6 +31,7 @@ RUN ./Configure --prefix=/usr/local linux-x86_64 no-async no-engine -DOPENSSL_NO RUN make -j 8 RUN make install -j 8 WORKDIR /home/ +RUN rm -r openssl-$SSL_VER # build libssh2 ENV SSH2_VER=1.10.0 @@ -40,6 +42,7 @@ RUN CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib64" ./configure --pre RUN make -j 8 RUN make install WORKDIR /home/ +RUN rm -r libssh2-$SSH2_VER # build libcurl ENV CURL_VER=7.80.0 @@ -50,6 +53,7 @@ RUN ./configure --with-libssh2 --with-ssl --prefix=/usr/local --enable-get-easy- RUN make -j 8 RUN make install -j 8 WORKDIR /home/ +RUN rm -r curl-$CURL_VER # build htslib ENV HTS_VER=1.14 @@ -59,25 +63,26 @@ WORKDIR htslib-$HTS_VER RUN ./configure --with-libdeflate --enable-libcurl RUN make -j 8 RUN make install - WORKDIR /home/ +RUN rm -r htslib-$HTS_VER # download parasail ENV PARASAIL_VER=2.4.3 -RUN wget https://github.com/jeffdaily/parasail/releases/download/v$PARASAIL_VER/parasail-$PARASAIL_VER-manylinux1_x86_64.tar.gz -RUN tar -xf parasail-$PARASAIL_VER-manylinux1_x86_64.tar.gz -RUN cp -r parasail-$PARASAIL_VER-manylinux1_x86_64/* /usr/local +RUN wget https://github.com/jeffdaily/parasail/releases/download/v$PARASAIL_VER/parasail-$PARASAIL_VER.tar.gz +RUN tar -xf parasail-$PARASAIL_VER.tar.gz +WORKDIR parasail-$PARASAIL_VER +RUN ./configure +RUN make -j 8 +RUN make install -# set dflags for ldc static building -ENV DFLAGS="-link-defaultlib-shared=false -static --linker=gold" -ENV DFLAGS="$DFLAGS -L-L/lib -L-L/usr/local/lib -L-L/usr/local/lib64 -L-L/usr/lib" -ENV DFLAGS="$DFLAGS -L-lz -L-lbz2 -L-ldeflate -L-llzma" -ENV DFLAGS="$DFLAGS -L-lcurl -L-lssl -L-lssh2 -L-lcrypto -L-lunwind" +WORKDIR /home/ +RUN rm -r parasail-$PARASAIL_VER ADD . /home/fade WORKDIR /home/fade -RUN dub build --compiler ldc2 + +RUN dub build --compiler ldc2 -c static-alpine -b release RUN cp fade /usr/local/bin diff --git a/dub.json b/dub.json index c8477d0..d1518ba 100644 --- a/dub.json +++ b/dub.json @@ -14,6 +14,28 @@ { "name":"shared", "targetType": "executable" + }, + { + "name":"static-alpine", + "targetType": "executable", + "dflags-ldc": [ + "-link-defaultlib-shared=false", + "-static", + "--linker=gold", + "-L-L/lib", + "-L-L/usr/local/lib", + "-L-L/usr/local/lib64", + "-L-L/usr/lib", + "-L-lz", + "-L-lbz2", + "-L-ldeflate", + "-L-llzma", + "-L-lcurl", + "-L-lssl", + "-L-lssh2", + "-L-lcrypto", + "-L-lunwind" + ] } ] }