-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 990 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
###
# Mainflux Dockerfile
###
FROM golang:alpine
MAINTAINER Mainflux
ENV MONGO_HOST mongo
ENV MONGO_PORT 27017
ENV EMQTTD_HOST emqttd
ENV EMQTTD_PORT 1883
###
# Install
###
RUN apk update && apk add git && apk add wget && rm -rf /var/cache/apk/*
# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/mainflux/mainflux-core
RUN mkdir -p /etc/mainflux/core
COPY config/config-docker.toml /etc/mainflux/core/config.toml
# Get and install the dependencies
RUN go get github.com/mainflux/mainflux-core
# Dockerize
ENV DOCKERIZE_VERSION v0.2.0
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
###
# Run main command with dockerize
###
CMD dockerize -wait tcp://$MONGO_HOST:$MONGO_PORT -wait tcp://$EMQTTD_HOST:$EMQTTD_PORT -timeout 10s /go/bin/mainflux-core /etc/mainflux/core/config.toml