Skip to content

Instantly share code, notes, and snippets.

@rossf7
Last active January 14, 2019 07:02
Show Gist options
  • Save rossf7/664dc1eb02f514993c7215d37058965c to your computer and use it in GitHub Desktop.
Save rossf7/664dc1eb02f514993c7215d37058965c to your computer and use it in GitHub Desktop.
Build hook for a Docker Hub automated build
#!/bin/bash
# File needs to be called /hooks/build relative to the Dockerfile.
# $IMAGE_NAME var is injected into the build so the tag is correct.
echo "Build hook running"
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
-t $IMAGE_NAME .
@zffocussss
Copy link

Hi ross:
How do I automatically trigger remote action after images are build successfully?I use pipeline of Bitbucket,it is ok if we can execute remote script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment