-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In case this might be interesting to anyone, this PR adds a multistage Dockerfile based on the latest Ubuntu, compiles the project using the `Makefile` and copies the resulting binary to a new, clean, image.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM ubuntu as compiler | ||
|
||
RUN apt update | ||
|
||
# Install tzdata without being interactive | ||
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata | ||
|
||
# Tools to compile: | ||
RUN apt install -y build-essential cmake clang-format shellcheck curl | ||
|
||
COPY . /compile | ||
WORKDIR /compile | ||
|
||
RUN make configure | ||
RUN make compile | ||
|
||
FROM ubuntu | ||
COPY --from=compiler /compile/build/dist/bin/jsonschema /usr/local/bin/jsonschema | ||
WORKDIR /schema | ||
ENTRYPOINT ["/usr/local/bin/jsonschema"] |
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