summaryrefslogtreecommitdiff
path: root/docker-vyos/Dockerfile
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-06-24 21:27:58 +0300
committerzsdc <taras@vyos.io>2020-06-25 14:57:16 +0300
commitebc80decd21a448de58cc7e551e98949e96113d0 (patch)
treedfa0a4996c98072204609b9472a8ce3ec16718a8 /docker-vyos/Dockerfile
parent488ebdf6ca0de558dbbadcab1342f7625aa3a588 (diff)
downloadvyos-build-ebc80decd21a448de58cc7e551e98949e96113d0.tar.gz
vyos-build-ebc80decd21a448de58cc7e551e98949e96113d0.zip
Docker: T2640: Added ability to build Docker images with VyOS
This implementation works, but it is on the proof-of-concept stage and requires extended testing.
Diffstat (limited to 'docker-vyos/Dockerfile')
-rw-r--r--docker-vyos/Dockerfile68
1 files changed, 68 insertions, 0 deletions
diff --git a/docker-vyos/Dockerfile b/docker-vyos/Dockerfile
new file mode 100644
index 00000000..cfe505ef
--- /dev/null
+++ b/docker-vyos/Dockerfile
@@ -0,0 +1,68 @@
+# syntax = docker/dockerfile:1
+
+# Copyright (C) 2020 VyOS maintainers and contributors
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or later as
+# published by the Free Software Foundation.
+#
+# 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/>.
+
+# Define arguments for VyOS image
+ARG VYOS_VERSION
+ARG BUILD_DATE
+ARG DEBIAN_VERSION
+
+# Use Debian as base layer
+FROM debian:${DEBIAN_VERSION}-slim
+# Copy installer script and default build settings
+COPY [ "data/defaults.json", "data/live-build-config/archives/*", "docker-vyos/vyos_install_common.sh", "docker-vyos/vyos_install_stage_01.sh", "/tmp/" ]
+COPY [ "data/live-build-config/hooks/live/*", "/tmp/hooks/" ]
+
+
+# Install VyOS dependencies
+WORKDIR /tmp
+RUN bash /tmp/vyos_install_stage_01.sh
+
+
+# Install VyOS specific software
+COPY [ "data/defaults.json", "docker-vyos/vyos_install_common.sh", "docker-vyos/vyos_install_stage_02.sh", "/tmp/" ]
+RUN bash /tmp/vyos_install_stage_02.sh
+
+
+# Tune system for VyOS
+COPY [ "docker-vyos/vyos_install_common.sh", "docker-vyos/vyos_install_stage_03.sh", "/tmp/" ]
+# Copy skel for bash profile
+COPY data/live-build-config/includes.chroot/etc/skel/.bashrc /etc/skel/.bashrc
+# Copy default config
+COPY data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default /opt/vyatta/etc/
+
+RUN bash /tmp/vyos_install_stage_03.sh
+
+# Delete installer scripts
+RUN rm -rf /tmp/*
+
+
+# Make changes specific to the container environment
+
+# Tell systemd that we are inside container
+ENV container=docker
+
+# Set proper STOPSIGNAL
+STOPSIGNAL SIGRTMIN+3
+
+# Run VyOS
+CMD [ "/lib/systemd/systemd" ]
+
+# Describe this image
+LABEL maintainer="support@vyos.io" \
+ description="VyOS for Docker" \
+ vendor="Sentrium S.L." \
+ version=${VYOS_VERSION} \
+ io.vyos.build-date=${BUILD_DATE}