Skip to content

Commit

Permalink
Fix docker tag step in parameterized_docker_build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
caisq committed Aug 25, 2016
1 parent 3752851 commit cff3c60
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tensorflow/tools/docker/parameterized_docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,21 @@ fi

# Apply the final image name and tag
FINAL_IMG="${FINAL_IMAGE_NAME}:${FINAL_TAG}"
docker tag -f "${IMG}" "${FINAL_IMG}" || \

DOCKER_VER=$(docker version | grep Version | head -1 | awk '{print $NF}')
if [[ -z "${DOCKER_VER}" ]]; then
die "ERROR: Failed to determine docker version"
fi
DOCKER_MAJOR_VER=$(echo "${DOCKER_VER}" | cut -d. -f 1)
DOCKER_MINOR_VER=$(echo "${DOCKER_VER}" | cut -d. -f 2)

FORCE_TAG=""
if [[ "${DOCKER_MAJOR_VER}" -le 1 ]] && \
[[ "${DOCKER_MINOR_VER}" -le 9 ]]; then
FORCE_TAG="--force"
fi

docker tag ${FORCE_TAG} "${IMG}" "${FINAL_IMG}" || \
die "Failed to tag intermediate docker image ${IMG} as ${FINAL_IMG}"

echo ""
Expand Down

0 comments on commit cff3c60

Please sign in to comment.