Skip to content

Commit

Permalink
Added a .dockerignore file (#3418)
Browse files Browse the repository at this point in the history
Added a .dockerignore file to the gatk which prevents test resources from being loaded into the docker image in order to reduce the side of the docker image.
fixes #3414
  • Loading branch information
jamesemery authored Aug 10, 2017
1 parent e552656 commit c655fef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are files that for whatever reason we don't want to include in our distribution docker images
src/test/resources
src/test/resources/*
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ RUN java -jar gatk.jar -h

#Setup test data
WORKDIR /gatk
# remove existing test data
RUN rm -rf src/test/resources
# Create link to where test data is expeced
# Create link to where test data is expected
RUN ln -s /testdata src/test/resources

# Create a simple unit test runner
Expand Down
11 changes: 5 additions & 6 deletions build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if [ -n "$STAGING_DIR" ]; then
set -e
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/${REPO}/${PROJECT}.git ${STAGING_DIR}/${STAGING_CLONE_DIR}
cd ${STAGING_DIR}/${STAGING_CLONE_DIR}
STAGING_ABSOLUTE_PATH=$(pwd)
STAGING_ABSOLUTE_PATH=$(pwd)

echo "Now in $(pwd)"
if [ ${PULL_REQUEST_NUMBER} ]; then
Expand All @@ -102,11 +102,6 @@ if [ -n "$STAGING_DIR" ]; then
GIT_CHECKOUT_COMMAND="git checkout ${GITHUB_DIR}${GITHUB_TAG}"
echo "${GIT_CHECKOUT_COMMAND}"
${GIT_CHECKOUT_COMMAND}
if [ -z "${IS_NOT_RUN_UNIT_TESTS}" ] ; then
git lfs pull
chmod -R a+w ${STAGING_ABSOLUTE_PATH}/*
chmod a+w ${STAGING_ABSOLUTE_PATH}/
fi
fi

# Build
Expand All @@ -122,6 +117,10 @@ if [ -z "${IS_NOT_RUN_UNIT_TESTS}" ] ; then
REMOVE_CONTAINER_STRING=" "
fi

git lfs pull
chmod -R a+w ${STAGING_ABSOLUTE_PATH}/*
chmod a+w ${STAGING_ABSOLUTE_PATH}/

echo docker run ${REMOVE_CONTAINER_STRING} -v ${STAGING_ABSOLUTE_PATH}/src/test/resources:/testdata -t ${REPO_PRJ}:${GITHUB_TAG} bash /root/run_unit_tests.sh
docker run ${REMOVE_CONTAINER_STRING} -v ${STAGING_ABSOLUTE_PATH}/src/test/resources:/testdata -t ${REPO_PRJ}:${GITHUB_TAG} bash /root/run_unit_tests.sh
echo " Unit tests passed..."
Expand Down

0 comments on commit c655fef

Please sign in to comment.