Skip to content

Commit

Permalink
Merge pull request #3 from clojerl/dockerfile
Browse files Browse the repository at this point in the history
Dockerfile
  • Loading branch information
jfacorro authored Oct 8, 2017
2 parents 57e9095 + b728433 commit c930068
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 11 deletions.
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
FROM jfacorro/clojerl:armhf-alpine
FROM arm32v6/alpine:3.6

# Install build deps
RUN apk add --no-cache --virtual .try-clojerl-build-deps git make \
# Checkout
&& git clone --depth 1 https://github.com/clojerl/try_clojerl try_clojerl \
&& cd try_clojerl \
&& rebar3 clojerl compile \
&& rebar3 release \
# Clean deps
&& apk del .try-clojerl-build-deps
RUN apk add --update ncurses openssl

ENTRYPOINT /try_clojerl/_build/default/rel/try_clojerl/bin/try_clojerl foreground
COPY _build/prod/rel/try_clojerl /opt/try_clojerl

ENTRYPOINT /opt/try_clojerl/bin/try_clojerl foreground
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: all

BUILD_IMAGE = jfacorro/erlang:20.1.1-armhf-alpine
DOCKER_REPO = jfacorro/try_clojerl
DOCKER_TAG = $(shell git describe --always 2>/dev/null || echo 0)

all:
rebar3 clojerl compile

release: all
rebar3 as prod release

docker-build:
@ docker run -i \
-v ${PWD}:/project \
-w /project \
${BUILD_IMAGE} scripts/build

docker: docker-build
@ docker build -t ${DOCKER_REPO}:${DOCKER_TAG} .
11 changes: 11 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@
, {extended_start_script, true}
]
}.

{ profiles
, [ { prod
, [ {relx, [{dev_mode, false}, {include_erts, true}]}
, { provider_hooks
, [{post, [{compile, {clojerl, compile}}]}]
}
]
}
]
}.
11 changes: 11 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# Install deps
apk add --update git make wget

# Install rebar3
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
mv rebar3 /usr/local/bin/rebar3

# Build release
make release

0 comments on commit c930068

Please sign in to comment.