diff options
| author | ckonstanski <ckonstanski@pippiandcarlos.com> | 2017-11-21 14:29:44 -0700 |
|---|---|---|
| committer | ckonstanski <ckonstanski@pippiandcarlos.com> | 2017-11-21 14:29:44 -0700 |
| commit | e5919dd0b788b44400db6634060d6837537c33b0 (patch) | |
| tree | 3751d6a7b43575b5427861322b6dfa6ae799d39f /salt/openbook/baseimage/files/build.sh | |
| parent | 2bb7e9dee43365bb70c926e47e551d05e57971da (diff) | |
added baseimage
Diffstat (limited to 'salt/openbook/baseimage/files/build.sh')
| -rw-r--r-- | salt/openbook/baseimage/files/build.sh | 20 |
1 files changed, 20 insertions, 0 deletions
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 |
