From bbb0cf51e7bf323a5ab41e9c0098a5c0b753f892 Mon Sep 17 00:00:00 2001 From: Vitalii Elenhaupt Date: Sat, 25 Aug 2018 13:55:07 +0300 Subject: [PATCH] Use make to build ameba in docker, add installation info --- .dockerignore | 10 +++------- Dockerfile | 4 ++-- README.md | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 29ba7ad0..69e9d6b5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,4 @@ .* -Dockerfile -Makefile -bench/ -bin/ -spec/ - -*.html +!Makefile +!shard.yml +!src \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 859f540f..bb8a924e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM alpine:3.8 as builder -RUN apk add --update crystal shards openssl-dev yaml-dev libxml2-dev musl-dev +RUN apk add --update crystal shards openssl-dev yaml-dev musl-dev make RUN mkdir /ameba WORKDIR /ameba COPY . /ameba/ -RUN shards build --release +RUN make clean && make FROM alpine:3.8 RUN apk add --update openssl yaml pcre gc libevent libgcc diff --git a/README.md b/README.md index d62f3d5f..2e19f321 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,20 @@ $ brew tap veelenga/tap $ brew install ameba ``` +### Docker + +Build the image: + +```sh +$ docker build -t ameba/ameba . +``` + +To use the resulting image on a local source folder, mount the current (or target) directory into `/src`: + +```sh +$ docker run -v $(pwd):/src ameba/ameba +``` + ### From sources ```sh