Added DOCKER_OTHER_OPTIONS and started patching for windows

This commit is contained in:
Andy Neff 2015-08-16 11:18:45 -04:00
parent 4457d7c7c5
commit 5f033e5019
4 changed files with 31 additions and 15 deletions

@ -27,12 +27,17 @@ dependencies)
./docker/test_dockers.bsh
##Using the Dockers##
## Using the Dockers ##
All docker commands need to either be run as root **or** as a user with docker
permissions. Adding your user name to the docker group (or setting up boot2docker
environment) is probably the easiest.
For Mac and Windows users, the git-lfs repo needs to be in your Users directory
or else boot2docker magic won't work. Alternatively, you could add addition
mount points like
[this](http://stackoverflow.com/questions/26639968/boot2docker-startup-script-to-mount-local-shared-folder-with-host)
### Running Dockers ###
In order to run the dockers, the docker has to be built, and then run with a
@ -74,7 +79,7 @@ The script that takes care of ALL of these details for you is
./docker/build_dockers.bsh
###Development in Dockers###
### Development in Dockers ###
Sometimes you don't want to just build git-lfs and destroy the container, you
want to get in there, run a lot of command, debug, develop, etc... To do this,
@ -150,6 +155,13 @@ exit. If set to 0, the docker containers will not be automatically deleted upon
exit. This can be useful for a post mortem analysis (using other docker commands
not covered here). Just make sure you clean up the docker containers manually.
`DOCKER_OTHER_OPTIONS` - Any additional arguments you may want to pass to the
docker run command. This can be particularly useful when having to help docker
with dns, etc... For example `DOCKER_OTHER_OPTIONS="--dns 8.8.8.8"`
If for some reason on Windows, you need to add a -v mount, folder names need to
start with `//driveleter/dir...` instead of `/driveleter/dir...` to fool MINGW32
### Build Docker Environment Variables ###
`export` before calling `run_docker.bsh`/`build_docker.bsh`.
@ -158,7 +170,7 @@ not covered here). Just make sure you clean up the docker containers manually.
environment. This does not need to be bumped every version. This can be a tag
or a sha.
##Deploying/Building Repositories##
## Deploying/Building Repositories ##
When `./docker/run_dockers.bsh` is done building git-lfs and generating packages,
it automatically creates a repository for distribution too. Each distro gets a

@ -32,8 +32,7 @@ for IMAGE_NAME in "${IMAGE_NAMES[@]}"; do
fi
echo Docker building ${NAME}
${CUR_DIR}/docker+.bsh ${IMAGE_NAME} > ${CUR_DIR}/tmp.dockerfile
$SUDO docker build -t git-lfs/${NAME} -f ${CUR_DIR}/tmp.dockerfile ${CUR_DIR}
rm ${CUR_DIR}/tmp.dockerfile
${CUR_DIR}/docker+.bsh ${IMAGE_NAME} > ${CUR_DIR}/Dockerfile
$SUDO docker build -t git-lfs/${NAME} ${CUR_DIR}
rm ${CUR_DIR}/Dockerfile
done

@ -16,11 +16,9 @@ for FILE in "${FILES[@]}"; do
fi
while IFS='' read -r LINE || [ -n "${LINE}" ]; do
#My template substitution
while [[ "$LINE" =~ (\[\{)([A-Za-z0-9_]*)(\}\]) ]]; do
LINE=${LINE/"${BASH_REMATCH[0]}"/${!BASH_REMATCH[2]-}}
done
#https://gist.github.com/niclashoyer/8146033
LINE=$(echo "$LINE" | perl -p -e 's/\[\{([^}:]+)(:([^}:]+))?\}\]/defined $ENV{$1} ? $ENV{$1} : $3/eg')
#My SOURCE substitution
if echo $LINE | grep -q ^SOURCE; then
SOURCE=$(echo "${LINE}" | sed -E 's|^SOURCE[ ]+(.*)|\1|')

@ -16,6 +16,13 @@
set -eu
#Mingw32 auto converts /drive/dir/blah to drive:\dir\blah ... Can't have that.
if [[ `uname` == MINGW* ]]; then
MINGW_PATCH='/'
else
MINGW_PATCH=''
fi
CUR_DIR=$(cd $(dirname "${BASH_SOURCE[0]}"); pwd)
REPO_DIR=$(cd ${CUR_DIR}/..; pwd)
PACKAGE_DIR=${REPO_DIR}/repos
@ -87,12 +94,12 @@ for DOCKER_FILE in "${IMAGES[@]}"; do
echo Compiling LFS in docker image ${IMAGE_NAME}
IMAGE_REPO_DIR="${PACKAGE_DIR}"/"${IMAGE_INFO[1]}"/"${IMAGE_INFO[2]}"
$SUDO docker run "${OTHER_OPTIONS[@]}" \
$SUDO docker run "${OTHER_OPTIONS[@]}" ${DOCKER_OTHER_OPTIONS-} \
-e REPO_HOSTNAME=${REPO_HOSTNAME:-git-lfs.github.com} \
-e FINAL_UID=${FINAL_UID} \
-e FINAL_GID=${FINAL_GID} \
-v ${REPO_DIR}:/src \
-v ${IMAGE_REPO_DIR}:/repo \
-v "${MINGW_PATCH}${REPO_DIR}:/src" \
-v "${MINGW_PATCH}${IMAGE_REPO_DIR}:/repo" \
git-lfs/${IMAGE_NAME} ${DOCKER_CMD-}
done