diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-01-26 10:08:22 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-01-26 10:08:22 +0100 |
commit | 1daf1a0fc16033cd4c9e6f8bf1dfd3a90d369a64 (patch) | |
tree | 66ef9943181e65f8b328deb72b5372d24601c347 /docker | |
parent | e81343f0838a84be80846d0b2288d3f114a57338 (diff) | |
parent | fdf47c42269f7adb7d5f3e60b8180e8b9bc77503 (diff) | |
download | vyos-build-1daf1a0fc16033cd4c9e6f8bf1dfd3a90d369a64.tar.gz vyos-build-1daf1a0fc16033cd4c9e6f8bf1dfd3a90d369a64.zip |
Merge branch 'current' of github.com:c-po/vyos-build into current
* 'current' of github.com:c-po/vyos-build:
Jenkins: cleanup
Docker: Make OPAM system wide available
When building linux-kernel use number of host CPUs on parallel build
When building parse Git commit ID
When building frr clean out Git repository first
Fix --verbose option when building submodules
Build submodules in parallel with number of host CPUs
submodules: add igmpproxy
submodules: add vyos-xe-guest-utilities
Diffstat (limited to 'docker')
-rw-r--r-- | docker/Dockerfile | 30 | ||||
-rwxr-xr-x | docker/entrypoint.sh | 4 |
2 files changed, 23 insertions, 11 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 0d49bfe9..b27abe39 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y \ curl \ make \ sudo \ + mc \ live-build \ pbuilder \ devscripts \ @@ -190,10 +191,13 @@ RUN apt-get update && apt-get install -y \ # Packages needed for libvyosconfig RUN curl https://raw.githubusercontent.com/ocaml/opam/2.0.2/shell/install.sh --output /tmp/opam_install.sh && \ sed -i 's/read BINDIR/BINDIR=""/' /tmp/opam_install.sh && sh /tmp/opam_install.sh && \ - opam init --disable-sandboxing && \ - eval $(opam env) && opam switch create 4.07.0 && \ - eval $(opam env) && opam install -y oasis && \ - eval $(opam env) && opam install -y \ + opam init --root=/opt/opam --comp=4.07.0 --disable-sandboxing + +RUN eval $(opam env --root=/opt/opam --set-root) && \ + opam install -y \ + oasis + +RUN eval $(opam env --root=/opt/opam --set-root) && opam install -y \ fileutils \ lwt \ lwt_ppx \ @@ -210,21 +214,21 @@ RUN curl https://raw.githubusercontent.com/ocaml/opam/2.0.2/shell/install.sh --o ctypes-foreign \ menhir -RUN eval $(opam env) && opam install -y \ +RUN eval $(opam env --root=/opt/opam --set-root) && opam install -y \ ctypes # Build VyConf which is required to build libvyosconfig -RUN eval $(opam env) && \ - git clone https://github.com/vyos/vyconf.git && \ - cd vyconf && \ - git checkout 0f121c12a84200 && \ +RUN eval $(opam env --root=/opt/opam --set-root) && \ + git clone https://github.com/vyos/vyconf.git /tmp/vyconf && \ + cd /tmp/vyconf && \ + git checkout v0.1 && \ opam pin add vyconf . # Build libvyosconfig -RUN eval $(opam env) && \ +RUN eval $(opam env --root=/opt/opam --set-root) && \ git clone https://github.com/vyos/libvyosconfig && \ cd libvyosconfig && \ - git checkout e75e4ae638c49e && \ + git checkout v0.0.4 && \ dpkg-buildpackage -uc -us -tc -b && \ dpkg -i ../libvyosconfig0_*_amd64.deb @@ -232,6 +236,10 @@ RUN eval $(opam env) && \ RUN apt-get update && apt-get install -y \ whois +# Packages needed for vyos-xe-guest-utilities +RUN apt-get update && apt-get install -y \ + golang + # Update live-build RUN echo 'deb http://ftp.debian.org/debian stretch main' | tee -a /etc/apt/sources.list.d/stretch.list && \ apt-get update && apt-get install -y -t stretch live-build && \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 8db41103..ed6ca7d9 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -23,6 +23,10 @@ if ! grep -q $NEW_GID /etc/group; then groupadd --gid $NEW_GID $USER_NAME fi +# libvyosconfig depends on OCaml/OPAM so we make sure +# we can use it +echo "eval \$(opam env --root=/opt/opam --set-root)" >> /etc/skel/.bashrc + useradd --shell /bin/bash --uid $NEW_UID --gid $NEW_GID --non-unique --create-home $USER_NAME usermod --append --groups sudo $USER_NAME sudo chown $NEW_UID:$NEW_GID /home/$USER_NAME |