-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dockerfile with static build and example compose file
Signed-off-by: Daniel Thamdrup <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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 |
---|---|---|
@@ -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.