Upgrade Alpine version + use multistage Docker build
-FROM alpine:3.6
+FROM alpine:3.10 AS builder
-MAINTAINER Fabian Groffen
+ADD . /opt/carbon-c-relay-build
+WORKDIR /opt/carbon-c-relay-build
-RUN mkdir -p /opt/carbon-c-relay-build
+RUN \
+ apk add --no-cache git bc build-base curl automake autoconf && \
+ ./configure && make
-RUN mkdir /etc/carbon-c-relay
+FROM alpine:3.10
-COPY . /opt/carbon-c-relay-build
+MAINTAINER Fabian Groffen
-RUN \
- apk --no-cache update && \
- apk --no-cache upgrade && \
- apk --no-cache add git bc build-base curl && \
- cd /opt/carbon-c-relay-build && \
- ./configure; make && \
- cp relay /usr/bin/carbon-c-relay && \
- apk del --purge git bc build-base ca-certificates curl && \
- rm -rf /opt/* /tmp/* /var/cache/apk/* /opt/carbon-c-relay-build
+RUN mkdir -p /etc/carbon-c-relay
+
+COPY --from=builder /opt/carbon-c-relay-build/relay /usr/bin/carbon-c-relay
EXPOSE 2003
