From ab13fb02a57c2ee4fc50f3c7a5fc96d8fc99cd55 Mon Sep 17 00:00:00 2001 From: James Hannah Date: Mon, 10 Dec 2018 15:06:11 +0000 Subject: [PATCH] Add a Dockerfile to this repository This commit adds a two-stage Docker build to this repository. The first step uses an Alpine Linux based image to build the source of jo, and then this stage is discarded (except for the compiled binary) and a new Alpine based image is produced containing the jo binary. The built image can then be executed as: [user@host] $ docker run --rm -ti jo a=b {"a": "b"} --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0601171 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine AS builder +RUN apk -U add automake autoconf build-base make +COPY . /src +WORKDIR /src +RUN autoreconf -i && ./configure && make check && make install + +FROM alpine +COPY --from=builder /usr/local/bin/jo /bin/jo +ENTRYPOINT ["/bin/jo"]