forked from p4lang/behavioral-model
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to this hook, behavioral-model:latest will be built from pi:latest and behavioral-model:stable will be built from pi:stable.
- Loading branch information
1 parent
d5ddf82
commit 44f83ca
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
FROM p4lang/pi:latest | ||
LABEL maintainer="Seth Fowler <[email protected]>" | ||
ARG PARENT_VERSION=latest | ||
FROM p4lang/pi:${PARENT_VERSION} | ||
LABEL maintainer="Antonin Bas <[email protected]>" | ||
|
||
# Default to using 2 make jobs, which is a good default for CI. If you're | ||
# building locally or you know there are more cores available, you may want to | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Hooks for dockerhub build. | ||
See [docker | ||
documentation](https://docs.docker.com/docker-cloud/builds/advanced/#override-build-test-or-push-commands). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# Overrides the default build command with one that sets PARENT_VERSION arg to | ||
# the appropriate value. behavioral-model:latest will be built from pi:latest, | ||
# while behavioral-model:stable will be built from pi:stable. Thanks to this we | ||
# don't have to duplicate the Dockerfile for the sake of dockerhub. | ||
|
||
# dockerhub uses DOCKER_TAG and not CACHE_TAG | ||
echo "DOCKER_TAG: $DOCKER_TAG" | ||
# echo "CACHE_TAG: $CACHE_TAG" | ||
# dockerhub seems to be using BUILD_PATH and not DOCKERFILE_PATH (which is | ||
# empty) | ||
echo "BUILD_PATH: $BUILD_PATH" | ||
# echo "DOCKERFILE_PATH: $DOCKERFILE_PATH" | ||
echo "IMAGE_NAME: $IMAGE_NAME" | ||
DOCKERFILE_PATH_OPTION= | ||
if [ "$BUILD_PATH" != "/" ]; then | ||
# remove leading '/' | ||
DOCKERFILE_PATH_OPTION="-f ${BUILD_PATH:1}" | ||
fi | ||
docker build --build-arg PARENT_VERSION=$DOCKER_TAG $DOCKERFILE_PATH_OPTION -t $IMAGE_NAME . |