mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
docker: improve build process of application image
This commit is contained in:
parent
4d71d41979
commit
5007c9c3de
3 changed files with 23 additions and 13 deletions
|
@ -1,5 +1,2 @@
|
|||
*
|
||||
!build/release/packaging/rpm/*
|
||||
!thirdparty/criterion/
|
||||
!thirdparty/libiec61850/
|
||||
thirdparty/*/build/
|
||||
build/
|
||||
packaging/docker/Dockerfile.*
|
||||
|
|
|
@ -24,8 +24,21 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
###################################################################################
|
||||
|
||||
FROM fedora:27
|
||||
ARG BUILDER_IMAGE=villas/node-dev
|
||||
|
||||
# This image is built by villas-node-git/packaging/docker/Dockerfile.dev
|
||||
FROM villas/node-dev:develop AS builder
|
||||
|
||||
COPY . /villas-node/
|
||||
|
||||
RUN rm -rf /villas-node/build
|
||||
WORKDIR /villas-node
|
||||
|
||||
#RUN dnf -y install
|
||||
|
||||
RUN make -j2 rpm-villas-node
|
||||
|
||||
FROM fedora:28
|
||||
|
||||
ARG GIT_REV=unkown
|
||||
ARG GIT_BRANCH=unkown
|
||||
|
@ -46,16 +59,12 @@ RUN dnf -y install \
|
|||
libcurl \
|
||||
jansson \
|
||||
iproute \
|
||||
kernel-modules-extra \
|
||||
module-init-tools
|
||||
|
||||
# Ugly: we need to invalidate the cache
|
||||
ADD https://villas.fein-aachen.org/packages/repodata/repomd.xml /tmp
|
||||
ADD https://villas.fein-aachen.org/packages/villas.repo /etc/yum.repos.d/
|
||||
|
||||
# Install the application
|
||||
RUN dnf -y --refresh install \
|
||||
villas-node \
|
||||
villas-node-doc
|
||||
COPY --from=builder /villas-node/build/Linux-x86_64-release/packaging/rpm/RPMS/x86_64/*.rpm /tmp/
|
||||
RUN dnf -y install /tmp/*.rpm
|
||||
|
||||
# For WebSocket / API access
|
||||
EXPOSE 80
|
||||
|
|
|
@ -50,6 +50,10 @@ $(DOCKER_RUN_TARGETS): run-docker-%: docker-%
|
|||
|
||||
$(DOCKER_TARGETS): docker-%: $(BUILDDIR)/packaging/docker/Image.%
|
||||
|
||||
ifneq ($(CI_COMMIT_TAG),)
|
||||
DOCKER_OPTS += --tag $(DOCKER_IMAGE)-$*:$(CI_COMMIT_TAG)
|
||||
endif
|
||||
|
||||
# The docker build targets use the --iidfile option to write the newly build image
|
||||
# id to an file. Make is using the modification timestamp of this file and the Dockerfile
|
||||
# to determine when the image needs to be rebuild.
|
||||
|
|
Loading…
Add table
Reference in a new issue