Skip to content

Commit

Permalink
updated to build in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesgregory committed Dec 6, 2021
1 parent 445b47c commit 7317d36
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
22 changes: 22 additions & 0 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
]
}

0 comments on commit 7317d36

Please sign in to comment.