Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile: avoid usage errors #681

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@

# this Dockerfile is expected to run with a checkout
# of the vzlogger source as the build context (working directory),
# which it will copy into the container and then build.

############################
# STEP 1 build executable binary
############################

FROM alpine:latest as builder

COPY . /vzlogger
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulling this up here breaks docker-cache caching of the package installations below :(

maybe just copy CMakeLists.txt to a dummy location, it changes rarely so the impact on the cache should be neglegible.
or accept to fail less early.

# ensure we error early if there is no source in the build context
COPY CMakeLists.txt /vzlogger/

RUN apk add --no-cache \
gcc \
g++ \
Expand Down Expand Up @@ -37,8 +46,6 @@ RUN git clone https://github.com/rscada/libmbus.git --depth 1 \
&& ./build.sh \
&& make install

COPY . /vzlogger

ARG build_test=off
RUN cmake -DBUILD_TEST=${build_test} \
&& make -j $(nproc --all || echo 1) \
Expand Down