Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#111 Pass tool version to dockerfile #112

Merged
merged 9 commits into from
Jan 21, 2025
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ or

`docker build -t javacore-analyser .`

If you want to build a particular version, you need to add `--build-arg version=` argument, for example:
`podman build --build-arg version='==2.1' -t javacore-analyser .`
or
`podman build --build-arg version='<2.1' -t javacore-analyser .`

To start the container:
`podman run -it --rm --name javacore-analyser --mount type=bind,src="local-dir-on-fs",target=/reports -p 5001:5000 javacore-analyser`

Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright IBM Corp. 2024 - 2024
# Copyright IBM Corp. 2024 - 2025
# SPDX-License-Identifier: Apache-2.0
#

Expand All @@ -13,5 +13,8 @@ EXPOSE 5000/tcp
RUN mkdir /reports
VOLUME ["/reports"]

RUN ["pip", "install", "--no-cache-dir", "javacore-analyser"]
# As default we do not set the version to have the latest one for build.
ARG version=
#RUN ["pip", "install", "--no-cache-dir", "--root-user-action", "ignore", "javacore-analyser${version}"]
RUN pip install --no-cache-dir --root-user-action ignore javacore-analyser${version}
CMD ["javacore_analyser_web", "--port=5000", "--reports-dir=/reports"]
Loading