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/
|
||||||
!build/release/packaging/rpm/*
|
packaging/docker/Dockerfile.*
|
||||||
!thirdparty/criterion/
|
|
||||||
!thirdparty/libiec61850/
|
|
||||||
thirdparty/*/build/
|
|
||||||
|
|
|
@ -24,8 +24,21 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# 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_REV=unkown
|
||||||
ARG GIT_BRANCH=unkown
|
ARG GIT_BRANCH=unkown
|
||||||
|
@ -46,16 +59,12 @@ RUN dnf -y install \
|
||||||
libcurl \
|
libcurl \
|
||||||
jansson \
|
jansson \
|
||||||
iproute \
|
iproute \
|
||||||
kernel-modules-extra \
|
|
||||||
module-init-tools
|
module-init-tools
|
||||||
|
|
||||||
# Ugly: we need to invalidate the cache
|
ADD https://villas.fein-aachen.org/packages/villas.repo /etc/yum.repos.d/
|
||||||
ADD https://villas.fein-aachen.org/packages/repodata/repomd.xml /tmp
|
|
||||||
|
|
||||||
# Install the application
|
COPY --from=builder /villas-node/build/Linux-x86_64-release/packaging/rpm/RPMS/x86_64/*.rpm /tmp/
|
||||||
RUN dnf -y --refresh install \
|
RUN dnf -y install /tmp/*.rpm
|
||||||
villas-node \
|
|
||||||
villas-node-doc
|
|
||||||
|
|
||||||
# For WebSocket / API access
|
# For WebSocket / API access
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
|
@ -50,6 +50,10 @@ $(DOCKER_RUN_TARGETS): run-docker-%: docker-%
|
||||||
|
|
||||||
$(DOCKER_TARGETS): docker-%: $(BUILDDIR)/packaging/docker/Image.%
|
$(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
|
# 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
|
# 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.
|
# to determine when the image needs to be rebuild.
|
||||||
|
|
Loading…
Add table
Reference in a new issue