Skip to content

Commit

Permalink
Merge pull request #8 from beeceej/speed-runtime-up
Browse files Browse the repository at this point in the history
LGTM: include binary in repo
  • Loading branch information
beeceej authored May 10, 2020
2 parents 4c75c12 + caff0d6 commit 8662c34
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
21 changes: 1 addition & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
FROM ocaml/opam2 as build
RUN sudo apt-get update -y && \
sudo apt-get install \
pkg-config \
libgmp-dev \
m4 \
netbase -y
RUN opam install -y dune \
tls \
cohttp \
cohttp-lwt-unix \
yojson \
atdgen
WORKDIR lgtm
ADD . .
RUN sudo chown -R opam:nogroup .
RUN ./bin/build

FROM debian:buster-slim
COPY --from=build /home/opam/opam-repository/lgtm/_build/default/src/main.exe lgtm
RUN apt-get update -y && apt-get install netbase -y
ADD bin bin
ADD . .
ENTRYPOINT ./bin/entrypoint
17 changes: 17 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ocaml/opam2 as build
WORKDIR lgtm
RUN sudo apt-get update -y && sudo apt-get install -y \
pkg-config \
libgmp-dev \
m4
RUN opam install -y dune \
tls \
cohttp \
cohttp-lwt-unix \
yojson \
atdgen
ADD . .
RUN sudo chown -R opam:nogroup .
RUN ./bin/build
RUN mkdir release
RUN mv _build/default/src/main.exe release/lgtm
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
VERSION := "v0.0.3"
RELEASE_IMAGE := beeceej/lgtm:release

release: clean lgtm
git tag -a "$(VERSION)" -m "release $(VERSION)"
git push --tags

lgtm: docker-release
docker run -it --rm -v "$${PWD}/release:/home/opam/opam-repository/lgtm/tmp" beeceej/lgtm:release mv release/lgtm tmp/lgtm
docker-release:
docker build -t $(RELEASE_IMAGE) -f Dockerfile.release .

clean:
rm -rf release

.PHONY: clean docker-release
2 changes: 1 addition & 1 deletion bin/entrypoint
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/sh

/lgtm
./release/lgtm
Binary file added release/lgtm
Binary file not shown.

0 comments on commit 8662c34

Please sign in to comment.