forked from splitbrain/docker-phpfarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-push-images.sh
executable file
·37 lines (30 loc) · 986 Bytes
/
build-push-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
#
# Build and push the images.
#
# Usage: build-push-images.sh mydockerhubuser/myreponame
# E.g. build-push-images.sh eugenesia/phpfarm
#
# Turn on Docker experimental mode to enable the --squash functionality.
# See https://github.com/docker/docker/tree/master/experimental
#
# Get the Docker hub user/repo so we know how to tag the built images and push
# them to Docker hub.
if [ -z "$1" ]; then
hubUserRepo='eugenesia/phpfarm'
echo "hubuser/repo not provided, defaulting to $hubUserRepo"
else
hubUserRepo="$1"
fi
# Be verbose.
set -vx
# Need to prefix with Docker.io to build on CircleCI.
docker build --squash -t ${hubUserRepo}:jessie -t \
${hubUserRepo}:latest -f Dockerfile-Jessie . \
> /tmp/build-jessie.log 2>&1
docker push ${hubUserRepo}:jessie
docker push ${hubUserRepo}:latest
docker build --squash -t ${hubUserRepo}:wheezy -f Dockerfile-Wheezy . > /tmp/build-wheezy.log 2>&1
docker push ${hubUserRepo}:wheezy
# Disable verbose.
set +vx