mirror of
https://github.com/jlengrand/jreleaser.git
synced 2026-03-10 08:31:24 +00:00
[chore] Add missing Docker templates
This commit is contained in:
@@ -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`,
|
||||
|
||||
@@ -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}}"]
|
||||
@@ -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 "$@"
|
||||
@@ -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}}"]
|
||||
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user