From 9518d2c701dd7c08556c053a7e2a97175541b6f1 Mon Sep 17 00:00:00 2001 From: Daniel Thamdrup Date: Thu, 11 Jul 2024 11:25:18 +0200 Subject: [PATCH 1/4] add dockerfile with static build and example compose file Signed-off-by: Daniel Thamdrup --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ docker-compose.yml | 0 2 files changed, 34 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..54830663 --- /dev/null +++ b/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..e69de29b From 7f5d99a11f17610008784ce32446bff9114979cc Mon Sep 17 00:00:00 2001 From: Daniel Thamdrup Date: Thu, 11 Jul 2024 11:28:37 +0200 Subject: [PATCH 2/4] forgot to save compose file Signed-off-by: Daniel Thamdrup --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 54830663..960a218c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,4 @@ RUN --mount=type=bind,readwrite,from=src,source=/src,target=/src \ FROM scratch AS runtime COPY --from=build /xmrig-proxy /xmrig-proxy -ENTRYPOINT [ "/xmrig-proxy" ] \ No newline at end of file +ENTRYPOINT [ "/xmrig-proxy" ] From ab7b828349da74fdc06800a6384d17487552aa20 Mon Sep 17 00:00:00 2001 From: Daniel Thamdrup Date: Thu, 11 Jul 2024 11:29:29 +0200 Subject: [PATCH 3/4] ffs Signed-off-by: Daniel Thamdrup --- docker-compose.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index e69de29b..7b3b2e70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +--- +services: + xmrig-proxy: + image: xmrig-proxy:latest + ports: + - 3333:3333 + volumes: + - ./xmrig-proxy.json:/.xmrig-proxy.json +... From f3c77b4227aa1e2552dbef222f7810ffeb0ff976 Mon Sep 17 00:00:00 2001 From: Daniel Thamdrup Date: Thu, 11 Jul 2024 11:30:55 +0200 Subject: [PATCH 4/4] correct image name in compose Signed-off-by: Daniel Thamdrup --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7b3b2e70..3965abb4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ --- services: xmrig-proxy: - image: xmrig-proxy:latest + image: xmrig/xmrig-proxy:latest ports: - 3333:3333 volumes: