Commit 7a825bf4 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼 Committed by Steffen Vogel

ci: overhaul docker builds

parent 5cae9f02
......@@ -7,7 +7,6 @@ variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE: registry.git.rwth-aachen.de/acs/public/villas/node
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev
MAKE_OPTS: -j32
RELEASEVER: '33'
DOCKER_CLI_EXPERIMENTAL: enabled
......@@ -32,7 +31,8 @@ before_script:
script:
- docker buildx build ${DOCKER_OPTS}
--file ${DOCKER_FILE}
--tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG} .
--tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
--target dev .
tags:
- shell
- linux
......@@ -40,38 +40,49 @@ before_script:
prepare:fedora:docker-dev:
<<: *prepare_docker_dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev
DISTRO: fedora
DOCKER_FILE: packaging/docker/Dockerfile.fedora
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-fedora
prepare:fedora:docker-dev-minimal:
<<: *prepare_docker_dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-minimal
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-minimal
DISTRO: fedora-minimal
DOCKER_FILE: packaging/docker/Dockerfile.fedora-minimal
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-fedora-minimal
prepare:ubuntu:docker-dev:
<<: *prepare_docker_dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-ubuntu
DISTRO: ubuntu
DOCKER_FILE: packaging/docker/Dockerfile.ubuntu
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-ubuntu
prepare:centos:docker-dev:
<<: *prepare_docker_dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-centos
DISTRO: centos
DOCKER_FILE: packaging/docker/Dockerfile.centos
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-centos
prepare:alpine:docker-dev:
<<: *prepare_docker_dev
variables:
DISTRO: alpine
DOCKER_FILE: packaging/docker/Dockerfile.alpine
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-alpine
prepare:debian-armhf:docker-dev:
<<: *prepare_docker_dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-debian-multiarch
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-debian-armhf
DOCKER_OPTS: --build-arg ARCH=armhf --build-arg TRIPLET=arm-linux-gnueabihf
prepare:debian-arm64:docker-dev:
<<: *prepare_docker_dev
variables:
DOCKER_FILE: packaging/docker/Dockerfile.dev-debian-multiarch
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-debian-arm64
DOCKER_OPTS: --build-arg ARCH=arm64 --build-arg TRIPLET=aarch64-linux-gnu
......@@ -88,7 +99,7 @@ prepare:debian-arm64:docker-dev:
expire_in: 1 week
paths:
- build/
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev-fedora:${DOCKER_TAG}
tags:
- docker
......@@ -98,7 +109,7 @@ build:fedora:x86_64:
build:fedora-minimal:x86_64:
<<: *build
variables:
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-minimal
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-fedora-minimal
CMAKE_OPTS: -DWITH_GRAPHVIZ=OFF
-DWITH_HOOKS=OFF
-DWITH_WEB=OFF
......@@ -115,7 +126,7 @@ build:fedora-minimal:x86_64:
build:fedora-minimal-default:x86_64:
<<: *build
variables:
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-minimal
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-fedora-minimal
build:ubuntu:x86_64:
<<: *build
......@@ -133,6 +144,12 @@ build:centos:x86_64:
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-centos
CMAKE_OPTS: -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake -DCMAKE_PREFIX_PATH=/usr/local
build:alpine:x86_64:
<<: *build
variables:
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-alpine
CMAKE_OPTS: -DCMAKE_INSTALL_PREFIX=/app -DCMAKE_PREFIX_PATH=/app -DWITH_FPGA=OFF
build:debian-multiarch:armhf:
<<: *build
variables:
......@@ -153,7 +170,7 @@ build:docs:
- mkdir -p build && cd build
- cmake ${CMAKE_OPTS} ..
- make ${MAKE_OPTS} doc
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
tags:
- docker
......@@ -165,7 +182,7 @@ test:flake8:
stage: test
script:
- flake8 python/
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
tags:
- docker
......@@ -185,7 +202,7 @@ test:cppcheck:
src/
lib/
tests/unit/ | tee cppcheck.log
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
dependencies:
- build:fedora:x86_64
tags:
......@@ -208,7 +225,7 @@ test:unit:
- mkdir -p build && cd build
- cmake ${CMAKE_OPTS} ..
- make ${MAKE_OPTS} run-unit-tests
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
tags:
- docker
......@@ -226,26 +243,34 @@ test:integration:
when: always
paths:
- build/tests/integration/
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
tags:
- docker
# Stage: packaging
##############################################################################
packaging:docker:
.packaging:docker: &packaging_docker
stage: packaging
image: docker:19.03
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build
--build-arg BUILDER_IMAGE=${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
--file packaging/docker/Dockerfile.app
--tag ${DOCKER_IMAGE}:${DOCKER_TAG} .
--target app
--file packaging/docker/Dockerfile.${DISTRO}
--tag ${DOCKER_IMAGE}:${DISTRO}-${DOCKER_TAG} .
tags:
- docker
packaging:docker:fedora:x86_64:
<<: *packaging_docker
variables:
DISTRO: fedora
packaging:docker:alpine:x86_64:
<<: *packaging_docker
variables:
DISTRO: alpine
packaging:rpm:
stage: packaging
dependencies:
......@@ -261,7 +286,7 @@ packaging:rpm:
paths:
- build/*.tar.gz
- build/*.rpm
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
image: ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
tags:
- docker
......@@ -302,20 +327,33 @@ deploy:web:
tags:
- docker
.deploy:docker: &deploy_docker_latest
deploy:packages:manual:
<<: *deploy_packages
when: manual
deploy:packages:tags:
<<: *deploy_packages
only:
# Only on version tags
- "/^v\\d+(\\.\\d+)+$/"
.deploy:docker: &deploy_docker
stage: deploy
image: docker:19.03
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
.deploy:docker:latest: &deploy_docker_latest
<<: *deploy_docker
script:
- docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
- docker tag ${DOCKER_IMAGE}/dev:${DOCKER_TAG} ${DOCKER_IMAGE}/dev:latest
- docker tag ${DOCKER_IMAGE}/dev-ubuntu:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-ubuntu:latest
- docker tag ${DOCKER_IMAGE}/dev-centos:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-centos:latest
- docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
- docker tag ${DOCKER_IMAGE}/dev-fedora:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-fedora:latest
- docker tag ${DOCKER_IMAGE}/dev-ubuntu:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-ubuntu:latest
- docker tag ${DOCKER_IMAGE}/dev-centos:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-centos:latest
- docker tag ${DOCKER_IMAGE}/dev-debian-arm64:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-debian-arm64:latest
- docker tag ${DOCKER_IMAGE}/dev-debian-armhf:${DOCKER_TAG} ${DOCKER_IMAGE}/dev-debian-armhf:latest
- docker push ${DOCKER_IMAGE}:latest
- docker push ${DOCKER_IMAGE}/dev:latest
- docker push ${DOCKER_IMAGE}/dev-fedora:latest
- docker push ${DOCKER_IMAGE}/dev-ubuntu:latest
- docker push ${DOCKER_IMAGE}/dev-centos:latest
- docker push ${DOCKER_IMAGE}/dev-debian-arm64:latest
......@@ -323,14 +361,21 @@ deploy:web:
tags:
- docker
deploy:docker:manual:
<<: *deploy_docker_latest
when: manual
deploy:docker:tags:
stage: deploy
image: docker:19.03
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
<<: *deploy_docker_latest
only:
# Only on version tags
- "/^v\\d+(\\.\\d+)+$/"
deploy:docker:tags:
<<: *deploy_docker
script:
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/dev-fedora:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/dev-ubuntu:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/dev-centos:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/dev-debian-arm64:${DOCKER_TAG}
......@@ -340,23 +385,3 @@ deploy:docker:tags:
only:
# Only on version tags
- "/^v\\d+(\\.\\d+)+$/"
deploy:packages:manual:
<<: *deploy_packages
when: manual
deploy:packages:tags:
<<: *deploy_packages
only:
# Only on version tags
- "/^v\\d+(\\.\\d+)+$/"
deploy:docker:manual:
<<: *deploy_docker_latest
when: manual
deploy:docker:tags:
<<: *deploy_docker_latest
only:
# Only on version tags
- "/^v\\d+(\\.\\d+)+$/"
......@@ -52,5 +52,3 @@ install(
COMPONENT devel
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig
)
add_subdirectory(docker)
......@@ -112,7 +112,7 @@ fi
# Build & Install uldaq
if ! pkg-config "libuldaq >= 1.0.0" && \
[ "${VARIANT}" != "debian-multiarch" ]; then
[ "${DISTRO}" != "debian-multiarch" ]; then
git clone https://github.com/stv0g/uldaq
pushd uldaq
git checkout rpmbuild
......
# CMakeLists.txt.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
# @license GNU General Public License (version 3)
#
# VILLASnode
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###################################################################################
set(DOCKER_FILE Dockerfile)
set(DOCKER_IMAGE registry.git.rwth-aachen.de/acs/public/villas/node)
set(DOCKER_TAG ${CMAKE_PROJECT_GIT_BRANCH})
set(DOCKER_RUN_OPTS
--interactive
--tty
--publish 80:80
--publish 443:443
--publish 12000:12000/udp
--publish 12001:12001/udp
--publish 2345:2345
--privileged
--security-opt seccomp:unconfined
--volume \"${PROJECT_SOURCE_DIR}:/villas\"
)
foreach(SUFFIX app dev dev-centos dev-ubuntu)
add_custom_target(deploy-docker-${SUFFIX}
COMMAND docker push ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}
COMMAND docker push ${DOCKER_IMAGE}/${SUFFIX}:latest
COMMENT "Deploy Docker image: ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}"
)
add_custom_target(run-docker-${SUFFIX}
COMMAND docker run ${DOCKER_RUN_OPTS} ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}
COMMENT "Run Docker image: ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}"
)
add_custom_target(docker-${SUFFIX}
COMMAND docker build
--file ${CMAKE_CURRENT_SOURCE_DIR}/Dockerfile.${SUFFIX}
--tag ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}
--tag ${DOCKER_IMAGE}/${SUFFIX}:latest
--build-arg BUILDER_IMAGE=${DOCKER_IMAGE}/dev:${DOCKER_TAG}
--build-arg DOCKER_TAG=${DOCKER_TAG}
--build-arg GIT_BRANCH=${CMAKE_PROJECT_GIT_BRANCH}
--build-arg GIT_REV=${CMAKE_PROJECT_GIT_REV}
--build-arg VERSION=${CMAKE_PROJECT_VERSION}
--build-arg VARIANT=${CMAKE_PROJECT_VARIANT}
${DOCKER_BUILD_OPTS} ${PROJECT_SOURCE_DIR}
COMMENT "Build Docker image: ${DOCKER_IMAGE}/${SUFFIX}:${DOCKER_TAG}"
)
add_dependencies(deploy-docker-${SUFFIX} docker-${SUFFIX})
add_dependencies(run-docker-${SUFFIX} docker-${SUFFIX})
endforeach()
# Special cases for 'docker' target
add_custom_target(run-docker
COMMAND docker run ${DOCKER_RUN_OPTS} ${DOCKER_IMAGE}:${DOCKER_TAG} node -h
COMMENT "Run Docker image: ${DOCKER_IMAGE}:${DOCKER_TAG}"
)
add_custom_target(docker
COMMAND docker tag ${DOCKER_IMAGE}/app:${DOCKER_TAG} ${DOCKER_IMAGE}:${DOCKER_TAG}
COMMAND docker tag ${DOCKER_IMAGE}/app:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
)
add_custom_target(deploy-docker DEPENDS docker-app
COMMAND docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
COMMAND docker push ${DOCKER_IMAGE}:latest
)
add_dependencies(docker docker-app)
add_dependencies(docker-app docker-dev)
add_dependencies(deploy-docker deploy-docker-app)
add_dependencies(run-docker docker)
......@@ -31,19 +31,19 @@
ARG GIT_REV=unknown
ARG GIT_BRANCH=unknown
ARG VERSION=unknown
ARG VARIANT=unknown
ARG ALPINE_VERSION=edge
ARG DISTRO=unknown
FROM alpine:${ALPINE_VERSION} AS builder
FROM alpine:edge AS dev
# Toolchain
RUN apk update && \
apk add gcc g++ \
pkgconf cmake make \
autoconf automake libtool \
git \
git mercurial \
flex bison \
protobuf
protobuf \
file
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
......@@ -68,24 +68,44 @@ RUN apk update && \
mosquitto-dev \
libusb-dev
ENV VARIANT=alpine
ENV DISTRO=alpine
ENV ARCH=x86_64
ENV TRIPLET=x86_64-linux-gnu
# Some fixes for Alpine
RUN echo -e "#!/bin/sh\n" | \
tee /usr/bin/udevadm | \
tee /bin/ldconfig && \
chmod +x /usr/bin/udevadm /bin/ldconfig && \
mv /sbin/ldconfig /sbin/ldconfig.orig
# Disabling a few dependencies due to incompatability with musl-libc:
# https://github.com/creytiv/re/issues/256
# https://github.com/mz-automation/libiec61850/issues/279
ENV SKIP_CRITERION=1
ENV SKIP_LIBRE=1
ENV PREFIX=/app
RUN mkdir /app
# Install unpackaged dependencies from source
# ADD packaging/deps.sh /
# RUN bash deps.sh && ldconfig
ADD packaging/deps.sh /
RUN bash deps.sh && \
ldconfig.orig /usr/local/lib /usr/lib
FROM dev AS builder
COPY . /villas/
RUN mkdir -p /villas/build
WORKDIR /villas/build
RUN cmake .. && \
make -j$(nproc) doc && \
make -j$(nproc) install && \
ldconfig
RUN cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_PREFIX_PATH=${PREFIX} .. && \
make -j$(nproc) install
FROM alpine:${ALPINE_VERSION}
FROM alpine:edge AS app
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add \
openssl \
......@@ -106,6 +126,12 @@ RUN apk add \
mosquitto \
libusb
COPY --from=builder /app /app
RUN ldconfig /app/lib /app/lib64
ENV LD_LIBRARY_PATH=/app/lib:/app/lib64
ENV PATH=/app/bin:${PATH}
LABEL \
org.label-schema.schema-version="1.0" \
org.label-schema.name="VILLASnode" \
......@@ -113,7 +139,6 @@ LABEL \
org.label-schema.vcs-ref="$GIT_REV" \
org.label-schema.vcs-branch="$GIT_BRANCH" \
org.label-schema.version="$VERSION" \
org.label-schema.variant="$VARIANT" \
org.label-schema.vendor="Institute for Automation of Complex Power Systems, RWTH Aachen University" \
org.label-schema.author.name="Steffen Vogel" \
org.label-schema.author.email="stvogel@eonerc.rwth-aachen.de" \
......@@ -121,3 +146,5 @@ LABEL \
org.label-schema.url="http://fein-aachen.org/projects/villas-framework/" \
org.label-schema.vcs-url="https://git.rwth-aachen.de/acs/public/villas/node" \
org.label-schema.usage="https://villas.fein-aachen.org/doc/node-installation.html#node-installation-docker"
ENTRYPOINT ["villas"]
# Dockerfile
#
# This image can be used for running VILLASnode
# by running:
# make docker
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
# @license GNU General Public License (version 3)
#
# VILLASnode
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###################################################################################
ARG BUILDER_IMAGE=villas/node-dev
ARG DOCKER_TAG=latest
ARG GIT_REV=unknown
ARG GIT_BRANCH=unknown
ARG VERSION=unknown
ARG VARIANT=unknown
# This image is built by villas-node-git/packaging/docker/Dockerfile.dev
FROM $BUILDER_IMAGE
COPY . /villas/
RUN rm -rf /villas/build && mkdir /villas/build
WORKDIR /villas/build
RUN cmake .. && \
make -j$(nproc) doc && \
make -j$(nproc) install && \
ldconfig
# For WebSocket / API access
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["villas"]
LABEL \
org.label-schema.schema-version = "1.0" \
org.label-schema.name = "VILLASnode" \
org.label-schema.license = "GPL-3.0" \
org.label-schema.vcs-ref="$GIT_REV" \
org.label-schema.vcs-branch="$GIT_BRANCH" \
org.label-schema.version="$VERSION" \
org.label-schema.variant="$VARIANT" \
org.label-schema.vendor = "Institute for Automation of Complex Power Systems, RWTH Aachen University" \
org.label-schema.author.name = "Steffen Vogel" \
org.label-schema.author.email = "stvogel@eonerc.rwth-aachen.de" \
org.label-schema.description = "A image containing for VILLASnode based on Fedora" \
org.label-schema.url = "http://fein-aachen.org/projects/villas-framework/" \
org.label-schema.vcs-url = "https://git.rwth-aachen.de/acs/public/villas/node" \
org.label-schema.usage = "https://villas.fein-aachen.org/doc/node-installation.html#node-installation-docker"
# Dockerfile
#
# This image can be used for running VILLASnode
# by running:
# make docker
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
# @license GNU General Public License (version 3)
#
# VILLASnode
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
###################################################################################
ARG BUILDER_IMAGE=villas/node-dev
ARG DOCKER_TAG=latest
ARG GIT_REV=unknown
ARG GIT_BRANCH=unknown
ARG VERSION=unknown
ARG VARIANT=unknown
# This image is built by villas-node-git/packaging/docker/Dockerfile.dev
FROM $BUILDER_IMAGE AS builder
COPY . /villas/
RUN rm -rf /villas/build && mkdir /villas/build
WORKDIR /villas/build
RUN cmake -DCPACK_GENERATOR=RPM -DWITH_NODE_ETHERCAT=OFF ..
RUN make -j$(nproc) doc
RUN make -j$(nproc) package
FROM fedora:32
# Some of the dependencies are only available in our own repo
ADD https://packages.fein-aachen.org/fedora/fein.repo /etc/yum.repos.d/
COPY --from=builder /villas/build/*.rpm /tmp/
RUN dnf -y install /tmp/*.rpm
# For WebSocket / API access
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["villas"]
LABEL \
org.label-schema.schema-version = "1.0" \
org.label-schema.name = "VILLASnode" \
org.label-schema.license = "GPL-3.0" \
org.label-schema.vcs-ref="$GIT_REV" \
org.label-schema.vcs-branch="$GIT_BRANCH" \
org.label-schema.version="$VERSION" \
org.label-schema.variant="$VARIANT" \
org.label-schema.vendor = "Institute for Automation of Complex Power Systems, RWTH Aachen University" \
org.label-schema.author.name = "Steffen Vogel" \
org.label-schema.author.email = "stvogel@eonerc.rwth-aachen.de" \
org.label-schema.description = "A image containing for VILLASnode based on Fedora" \
org.label-schema.url = "http://fein-aachen.org/projects/villas-framework/" \
org.label-schema.vcs-url = "https://git.rwth-aachen.de/acs/public/villas/node" \
org.label-schema.usage = "https://villas.fein-aachen.org/doc/node-installation.html#node-installation-docker"
......@@ -33,7 +33,7 @@ FROM centos:8
ARG GIT_REV=unknown
ARG GIT_BRANCH=unknown
ARG VERSION=unknown
ARG VARIANT=unknown
ARG DISTRO=unknown
USER root