Skip to content

Commit

Permalink
add dockerfile with static build and example compose file
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Thamdrup <[email protected]>
  • Loading branch information
dallemon committed Jul 11, 2024
1 parent 704060b commit b753ff4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# syntax=docker/dockerfile:latest
FROM scratch AS src
COPY . /src

FROM alpine:latest AS build
RUN --mount=type=bind,readwrite,from=src,source=/src,target=/src \
apk add \
alpine-sdk \
clang \
cmake \
libuv-dev \
libuv-static \
lld \
openssl-dev \
openssl-libs-static \
samurai && \
cmake \
-S /src \
-B /src/build \
-G Ninja \
-D BUILD_STATIC=ON \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \
-D CMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld -static -static-libgcc -static-libstdc++" \
-D OPENSSL_USE_STATIC_LIBS=ON \
-D WITH_HTTP=ON \
-D WITH_TLS=ON && \
cmake --build /src/build && \
mv /src/build/xmrig-proxy /xmrig-proxy

FROM scratch AS runtime
COPY --from=build /xmrig-proxy /xmrig-proxy
ENTRYPOINT [ "/xmrig-proxy" ]
Empty file added docker-compose.yml
Empty file.

0 comments on commit b753ff4

Please sign in to comment.