Skip to content

Dockerizing segvan#2

Open
kaplanmaxe wants to merge 1 commit into
nym-zone:masterfrom
kaplanmaxe:adding-docker
Open

Dockerizing segvan#2
kaplanmaxe wants to merge 1 commit into
nym-zone:masterfrom
kaplanmaxe:adding-docker

Conversation

@kaplanmaxe

Copy link
Copy Markdown

This PR adds docker to segvan. The idea behind this is that an image can be pushed to docker hub and a user could simply pull down the image and not have to worry about installation. Instructions have been added to README.md.

@matthewincognito

matthewincognito commented Mar 23, 2018

Copy link
Copy Markdown

Maybe it would be better if you did a multi-stage build, the first one a static build and the second one FROM scratch. The image be much smaller and wouldn't have any extra layers to pull in.

Something like this:

FROM alpine:edge AS builder

RUN apk add --no-cache \
    build-base \
    cmake \
    git \
    libuv-dev \
  && git clone https://github.com/xmrig/xmrig.git /xmrig \
  && mkdir /xmrig/build \
  && cd /xmrig/build \
  && cmake .. \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_HTTPD=OFF \
    -DCMAKE_EXE_LINKER_FLAGS="-static" \
    -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
  && make -j$(nproc) \
  && strip ./xmrig

FROM scratch

COPY --from=builder /xmrig/build/xmrig /

ENTRYPOINT ["/xmrig"]

@kaplanmaxe

Copy link
Copy Markdown
Author

@matthewincognito Thanks for the feedback! This could work as well... didn't spend much time on it. I don't think saving a few mbs here in the image is all that important considering it's not going into a production environment or anything. I guess I will leave it up to the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants