From b6ac14880baeaab2f6168af896a118c8e64fee5b Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 4 Sep 2018 22:13:08 +0200 Subject: [PATCH] fix --- basic-runtimes.sh | 7 ++++--- basic-runtimes/var/lib/lxc/{shared => build}/config | 8 ++++---- basic.sh | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) rename basic-runtimes/var/lib/lxc/{shared => build}/config (63%) diff --git a/basic-runtimes.sh b/basic-runtimes.sh index ec9650c..37641ae 100755 --- a/basic-runtimes.sh +++ b/basic-runtimes.sh @@ -4,9 +4,10 @@ set -e SOURCE_DIR=$(realpath $(dirname "${0}"))/basic-runtimes # Build basic Alpine image -mkdir -p /var/lib/lxc/shared/alpine -wget https://github.com/gliderlabs/docker-alpine/raw/2bfe6510ee31d86cfeb2f37587f4cf866f28ffbc/versions/library-3.8/x86_64/rootfs.tar.xz -O - | tar xJf - -C /var/lib/lxc/shared/alpine -cp ${SOURCE_DIR}/var/lib/lxc/shared/config /var/lib/lxc/shared/config +mkdir -p /var/lib/lxc/build/alpine +wget https://github.com/gliderlabs/docker-alpine/raw/2bfe6510ee31d86cfeb2f37587f4cf866f28ffbc/versions/library-3.8/x86_64/rootfs.tar.xz -O - | tar xJf - -C /var/lib/lxc/build/rootfs +cp ${SOURCE_DIR}/var/lib/lxc/build/config /var/lib/lxc/build/config +lxc-execute -n build -- /bin/sh -c 'apk --no-cache add s6' # Build Docker images docker build -t java ${SOURCE_DIR}/java diff --git a/basic-runtimes/var/lib/lxc/shared/config b/basic-runtimes/var/lib/lxc/build/config similarity index 63% rename from basic-runtimes/var/lib/lxc/shared/config rename to basic-runtimes/var/lib/lxc/build/config index c11764f..1b02d9d 100644 --- a/basic-runtimes/var/lib/lxc/shared/config +++ b/basic-runtimes/var/lib/lxc/build/config @@ -1,5 +1,5 @@ # Hostname -lxc.uts.name = shared +lxc.uts.name = build # Network lxc.net.0.type = veth @@ -9,11 +9,11 @@ lxc.net.0.ipv4.address = 172.17.0.2/16 lxc.net.0.ipv4.gateway = auto # Volumes -lxc.rootfs.path = /var/lib/lxc/shared/alpine +lxc.rootfs.path = /var/lib/lxc/build/rootfs # Mounts -lxc.mount.entry = /etc/hosts /etc/hosts none bind 0 0 -lxc.mount.entry = /etc/resolv.conf /etc/resolv.conf none bind 0 0 +lxc.mount.entry = /etc/hosts etc/hosts none bind 0 0 +lxc.mount.entry = /etc/resolv.conf etc/resolv.conf none bind 0 0 # Halt lxc.signal.halt = SIGTERM diff --git a/basic.sh b/basic.sh index 6ad9f5f..d6ae22e 100755 --- a/basic.sh +++ b/basic.sh @@ -60,7 +60,7 @@ vmmgr create-selfsigned cp ${SOURCE_DIR}/etc/nginx/nginx.conf /etc/nginx/nginx.conf # Configure services -for SERVICE in consolefont crond nginx ntpd lxd sshd swap vmmgr; do +for SERVICE in consolefont crond nginx ntpd lxc sshd swap vmmgr; do rc-update add ${SERVICE} boot service ${SERVICE} start done