Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile #3

Merged
merged 3 commits into from
Oct 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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