Skip to content

Commit

Permalink
Add a Dockerfile to this repository
Browse files Browse the repository at this point in the history
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"}
  • Loading branch information
jiphex committed Dec 10, 2018
1 parent 7ba387e commit ab13fb0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit ab13fb0

Please sign in to comment.