From e5919dd0b788b44400db6634060d6837537c33b0 Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Tue, 21 Nov 2017 14:29:44 -0700 Subject: added baseimage --- salt/openbook/baseimage/files/Dockerfile | 3 +++ salt/openbook/baseimage/files/build.sh | 20 ++++++++++++++++++++ salt/openbook/baseimage/files/installdeps.sh | 7 +++++++ 3 files changed, 30 insertions(+) create mode 100644 salt/openbook/baseimage/files/Dockerfile create mode 100644 salt/openbook/baseimage/files/build.sh create mode 100644 salt/openbook/baseimage/files/installdeps.sh (limited to 'salt/openbook/baseimage/files') diff --git a/salt/openbook/baseimage/files/Dockerfile b/salt/openbook/baseimage/files/Dockerfile new file mode 100644 index 0000000..0ead57e --- /dev/null +++ b/salt/openbook/baseimage/files/Dockerfile @@ -0,0 +1,3 @@ +FROM ubuntu:xenial +MAINTAINER Carlos Konstanski +RUN /installdeps.sh diff --git a/salt/openbook/baseimage/files/build.sh b/salt/openbook/baseimage/files/build.sh new file mode 100644 index 0000000..b33611c --- /dev/null +++ b/salt/openbook/baseimage/files/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Do not call directly. Meant to be called from CI build script. + +pushd {{ pillar["baseimage"]["build_dir"] }} 2>/dev/null + +echo "Deleting existing docker container" +docker stop {{ pillar["baseimage"]["container_name"] }} +docker container prune -f +docker rmi -f {{ pillar["baseimage"]["image_name"] }} + +echo "Building docker Ubuntu image" +docker build -t {{ pillar["baseimage"]["image_name"] }} . + +echo "Push docker image to the registry" +docker tag {{ pillar["baseimage"]["image_name"] }} {{ pillar["registry"]["url"] }}/{{ pillar["baseimage"]["image_name"] }} +docker push {{ pillar["registry"]["url"] }}/{{ pillar["baseimage"]["image_name"] }} + +popd 2>/dev/null +exit 0 diff --git a/salt/openbook/baseimage/files/installdeps.sh b/salt/openbook/baseimage/files/installdeps.sh new file mode 100644 index 0000000..1a1b1be --- /dev/null +++ b/salt/openbook/baseimage/files/installdeps.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive +apt-get update +apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade +apt-get -y install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" curl python openjdk-8-jre-headless +exit 0 -- cgit v1.3