-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISSUE-1204: Add HEALTHCHECK instruction for Dockerfiles
- Loading branch information
1 parent
ab86493
commit 3a29e42
Showing
3 changed files
with
241 additions
and
5 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 |
---|---|---|
|
@@ -155,6 +155,7 @@ LABEL [email protected] | |
workingDir('/tmp') | ||
onBuild('RUN echo "Hello World"') | ||
instruction('LABEL env=prod') | ||
healthcheck(new Dockerfile.Healthcheck('/bin/check-running')) | ||
} | ||
""" | ||
|
||
|
@@ -180,6 +181,7 @@ USER root | |
WORKDIR /tmp | ||
ONBUILD RUN echo "Hello World" | ||
LABEL env=prod | ||
HEALTHCHECK CMD /bin/check-running | ||
""") | ||
} | ||
|
||
|
@@ -202,6 +204,7 @@ LABEL env=prod | |
workingDir(project.provider { '/path/to/workdir' }) | ||
onBuild(project.provider { 'ADD . /app/src' }) | ||
instruction(project.provider { 'LABEL env=prod' }) | ||
healthcheck(project.provider { new Dockerfile.Healthcheck('/bin/check-running') }) | ||
} | ||
""" | ||
|
||
|
@@ -224,6 +227,7 @@ USER patrick | |
WORKDIR /path/to/workdir | ||
ONBUILD ADD . /app/src | ||
LABEL env=prod | ||
HEALTHCHECK CMD /bin/check-running | ||
""") | ||
} | ||
|
||
|
@@ -233,6 +237,7 @@ LABEL env=prod | |
task ${DOCKERFILE_TASK_NAME}(type: Dockerfile) { | ||
instructions.add(new Dockerfile.FromInstruction(new Dockerfile.From('$TEST_IMAGE_WITH_TAG'))) | ||
instructions.add(new Dockerfile.LabelInstruction(['maintainer': '[email protected]'])) | ||
instructions.add(new Dockerfile.HealthcheckInstruction(new Dockerfile.Healthcheck('/bin/check-running'))) | ||
} | ||
""" | ||
|
||
|
@@ -242,6 +247,7 @@ LABEL env=prod | |
then: | ||
assertDockerfileContent("""FROM $TEST_IMAGE_WITH_TAG | ||
LABEL [email protected] | ||
HEALTHCHECK CMD /bin/check-running | ||
""") | ||
} | ||
|
||
|
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
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