[chore] Add missing Docker templates

This commit is contained in:
Andres Almiray
2021-05-11 01:54:52 +02:00
parent 676aa73387
commit 04e40920cf
5 changed files with 85 additions and 1 deletions

View File

@@ -94,9 +94,12 @@ working directory at the `/workspace` volume, for example assuming the current d
[source]
----
$ docker run -it --rm -v `(pwd)`:/workspace jreleaser/jreleaser-slim:<tag> <command> [<args>]
$ docker run -it --rm -v `(pwd)`:/workspace \
jreleaser/<image>:<tag> <command> [<args>]
----
Where image may be `jreleaser-slim`, `jreleaser-alpine`.
NOTE: The `--basedir` argument will be automatically set to `--basedir=/workspace`.
You may also need to map environment variables to the container, such as `JRELEASER_PROJECT_VERSION`,

View File

@@ -0,0 +1,27 @@
FROM {{dockerBaseImage}}
{{#dockerLabels}}
LABEL {{.}}
{{/dockerLabels}}
{{#dockerPreCommands}}
{{.}}
{{/dockerPreCommands}}
COPY assembly/* /
RUN unzip {{distributionArtifactFileName}} && \
rm {{distributionArtifactFileName}} && \
chmod +x {{distributionArtifactName}}/bin/{{distributionExecutable}} && \
chmod +x {{distributionArtifactName}}/bin/java && \
mv /{{distributionExecutable}}-entrypoint.sh /{{distributionArtifactName}}/bin && \
chmod +x /{{distributionArtifactName}}/bin/{{distributionExecutable}}-entrypoint.sh
ENV PATH="${PATH}:/{{distributionArtifactName}}/bin"
{{#dockerPostCommands}}
{{.}}
{{/dockerPostCommands}}
ENTRYPOINT ["/{{distributionArtifactName}}/bin/{{distributionExecutable}}-entrypoint.sh"]
CMD ["/{{distributionArtifactName}}/bin/{{distributionExecutable}}"]

View File

@@ -0,0 +1,14 @@
#!/bin/sh
# if not running inside GitLab CI then specify the `jreleaser` command as default
if [ -z "${GITLAB_CI}" ]
then
ARGS="jreleaser"
WORKING_DIR="/workspace"
else
ARGS=""
WORKING_DIR="/"
fi
cd $WORKING_DIR
exec $ARGS "$@"

View File

@@ -0,0 +1,27 @@
FROM {{dockerBaseImage}}
{{#dockerLabels}}
LABEL {{.}}
{{/dockerLabels}}
{{#dockerPreCommands}}
{{.}}
{{/dockerPreCommands}}
COPY assembly/* /
RUN unzip {{distributionArtifactFileName}} && \
rm {{distributionArtifactFileName}} && \
chmod +x {{distributionArtifactName}}/bin/{{distributionExecutable}} && \
chmod +x {{distributionArtifactName}}/bin/java && \
mv /{{distributionExecutable}}-entrypoint.sh /{{distributionArtifactName}}/bin && \
chmod +x /{{distributionArtifactName}}/bin/{{distributionExecutable}}-entrypoint.sh
ENV PATH="${PATH}:/{{distributionArtifactName}}/bin"
{{#dockerPostCommands}}
{{.}}
{{/dockerPostCommands}}
ENTRYPOINT ["/{{distributionArtifactName}}/bin/{{distributionExecutable}}-entrypoint.sh"]
CMD ["/{{distributionArtifactName}}/bin/{{distributionExecutable}}"]

View File

@@ -0,0 +1,13 @@
#!/bin/bash
# if not running inside GitLab CI then specify the `jreleaser` command as default
if [[ -z "${GITLAB_CI}" ]]; then
ARGS="jreleaser"
WORKING_DIR="/workspace"
else
ARGS=""
WORKING_DIR="/"
fi
cd $WORKING_DIR
exec $ARGS "$@"