Update release scripts for release image.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
807ab89750
commit
4ae2a0e610
7 changed files with 39 additions and 6 deletions
48
script/run
48
script/run
|
|
@ -1,48 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Run docker-compose in a container
|
||||
#
|
||||
# This script will attempt to mirror the host paths by using volumes for the
|
||||
# following paths:
|
||||
# * $(pwd)
|
||||
# * $(dirname $COMPOSE_FILE) if it's set
|
||||
# * $HOME if it's set
|
||||
#
|
||||
# You can add additional volumes (or any docker run options) using
|
||||
# the $COMPOSE_OPTIONS environment variable.
|
||||
#
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
VERSION="1.4.0dev"
|
||||
# TODO: move this to an official repo
|
||||
IMAGE="dnephin/docker-compose:$VERSION"
|
||||
|
||||
|
||||
# Setup options for connecting to docker host
|
||||
if [ -z "$DOCKER_HOST" ]; then
|
||||
DOCKER_HOST="/var/run/docker.sock"
|
||||
fi
|
||||
if [ -S "$DOCKER_HOST" ]; then
|
||||
DOCKER_ADDR="-v $DOCKER_HOST:$DOCKER_HOST -e DOCKER_HOST"
|
||||
else
|
||||
DOCKER_ADDR="-e DOCKER_HOST"
|
||||
fi
|
||||
|
||||
|
||||
# Setup volume mounts for compose config and context
|
||||
VOLUMES="-v $(pwd):$(pwd)"
|
||||
if [ -n "$COMPOSE_FILE" ]; then
|
||||
compose_dir=$(dirname $COMPOSE_FILE)
|
||||
fi
|
||||
# TODO: also check --file argument
|
||||
if [ -n "$compose_dir" ]; then
|
||||
VOLUMES="$VOLUMES -v $compose_dir:$compose_dir"
|
||||
fi
|
||||
if [ -n "$HOME" ]; then
|
||||
VOLUMES="$VOLUMES -v $HOME:$HOME"
|
||||
fi
|
||||
|
||||
|
||||
exec docker run --rm -ti $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w $(pwd) $IMAGE $@
|
||||
Loading…
Add table
Add a link
Reference in a new issue