forked from bryanhong/docker-aptly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·33 lines (30 loc) · 815 Bytes
/
run.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
#!/bin/bash
source vars
#If there is a locally built image present, prefer that over the
#one in the registry, we're going to assume you're working on changes
#to the image.
if [[ ! -f builds ]]; then
LATESTIMAGE=${REPO_NAME}/${APP_NAME}:latest
else
LATESTIMAGE=`tail -1 builds | awk '{print $8}'`
fi
echo
echo "Starting $APP_NAME..."
echo
echo -n "Container ID: "
docker run \
--detach=true \
--log-driver=syslog \
--name="${APP_NAME}" \
--restart=always \
-e FULL_NAME="${FULL_NAME}" \
-e EMAIL_ADDRESS="${EMAIL_ADDRESS}" \
-e GPG_PASSWORD="${GPG_PASSWORD}" \
-e HOSTNAME="${HOSTNAME}" \
-v ${APTLY_DATADIR}:/opt/aptly \
-p ${DOCKER_HOST_PORT}:80 \
${LATESTIMAGE}
# Other useful options
# -p DOCKERHOST_PORT:CONTAINER_PORT \
# -e "ENVIRONMENT_VARIABLE_NAME=VALUE" \
# -v /DOCKERHOST/PATH:/CONTAINER/PATH \