mirror of
https://github.com/waku-org/nwaku.git
synced 2025-02-24 21:08:38 +00:00
fix Dockerfile by symlinking the wakunode binary
This is necessary becasue `COPY` creates a directory for some reason. Resolves: #166 Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
1157b6e7c5
commit
fabccdeca8
27
Dockerfile
27
Dockerfile
@ -1,5 +1,6 @@
|
|||||||
# BUILD IMAGE --------------------------------------------------------
|
# BUILD IMAGE --------------------------------------------------------
|
||||||
FROM alpine:3.11 AS nim-build
|
|
||||||
|
FROM alpine:3.12 AS nim-build
|
||||||
|
|
||||||
ARG NIM_PARAMS
|
ARG NIM_PARAMS
|
||||||
ARG MAKE_TARGET=wakunode
|
ARG MAKE_TARGET=wakunode
|
||||||
@ -7,24 +8,30 @@ ARG MAKE_TARGET=wakunode
|
|||||||
# Get build tools and required header files
|
# Get build tools and required header files
|
||||||
RUN apk add --no-cache bash build-base pcre-dev linux-headers git
|
RUN apk add --no-cache bash build-base pcre-dev linux-headers git
|
||||||
|
|
||||||
RUN mkdir /app
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ADD . .
|
COPY . .
|
||||||
|
|
||||||
# Ran separately from 'make' to avoid re-doing
|
# Ran separately from 'make' to avoid re-doing
|
||||||
RUN git submodule update --init --recursive
|
RUN git submodule update --init --recursive
|
||||||
|
|
||||||
# Build the node binary
|
# Slowest build step for the sake of caching layers
|
||||||
RUN make -j$(nproc) ${MAKE_TARGET} NIM_PARAMS="${NIM_PARAMS}"
|
RUN make -j$(nproc) deps
|
||||||
|
|
||||||
|
# Build the final node binary
|
||||||
|
RUN make -j$(nproc) $MAKE_TARGET NIM_PARAMS="$NIM_PARAMS"
|
||||||
|
|
||||||
# ACTUAL IMAGE -------------------------------------------------------
|
# ACTUAL IMAGE -------------------------------------------------------
|
||||||
FROM alpine:3.11
|
|
||||||
|
FROM alpine:3.12
|
||||||
|
|
||||||
|
ARG MAKE_TARGET=wakunode
|
||||||
|
|
||||||
LABEL maintainer="jakub@status.im"
|
LABEL maintainer="jakub@status.im"
|
||||||
LABEL source="https://github.com/status-im/nim-waku"
|
LABEL source="https://github.com/status-im/nim-waku"
|
||||||
LABEL description="Wakunode: Waku and Whisper client"
|
LABEL description="Wakunode: Waku and Whisper client"
|
||||||
|
|
||||||
EXPOSE 1234
|
# DevP2P, LibP2P, and JSON RPC ports
|
||||||
|
EXPOSE 30303 60000 8545
|
||||||
|
|
||||||
# Referenced in the binary
|
# Referenced in the binary
|
||||||
RUN apk add --no-cache libgcc pcre-dev
|
RUN apk add --no-cache libgcc pcre-dev
|
||||||
@ -32,7 +39,11 @@ RUN apk add --no-cache libgcc pcre-dev
|
|||||||
# Fix for 'Error loading shared library libpcre.so.3: No such file or directory'
|
# Fix for 'Error loading shared library libpcre.so.3: No such file or directory'
|
||||||
RUN ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3
|
RUN ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3
|
||||||
|
|
||||||
COPY --from=nim-build /app/build/${MAKE_TARGET} /usr/bin/wakunode
|
# Copy to separate location to accomodate different MAKE_TARGET values
|
||||||
|
COPY --from=nim-build /app/build/$MAKE_TARGET /usr/local/bin/
|
||||||
|
|
||||||
|
# Symlink the correct wakunode binary
|
||||||
|
RUN ln -sv /usr/local/bin/$MAKE_TARGET /usr/bin/wakunode
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/wakunode"]
|
ENTRYPOINT ["/usr/bin/wakunode"]
|
||||||
# By default just show help if called without arguments
|
# By default just show help if called without arguments
|
||||||
|
Loading…
x
Reference in New Issue
Block a user