diff --git a/Dockerfile b/Dockerfile index 63d9642..b9a4cf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Dockerfile.release b/Dockerfile.release new file mode 100644 index 0000000..52dd0fd --- /dev/null +++ b/Dockerfile.release @@ -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 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..de6cbc8 --- /dev/null +++ b/Makefile @@ -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 diff --git a/bin/entrypoint b/bin/entrypoint index 88d4eaf..bcbd6ef 100755 --- a/bin/entrypoint +++ b/bin/entrypoint @@ -1,3 +1,3 @@ #! /bin/sh -/lgtm +./release/lgtm diff --git a/release/lgtm b/release/lgtm new file mode 100755 index 0000000..aae6d21 Binary files /dev/null and b/release/lgtm differ