This repository has been archived by the owner on Dec 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile_dev
60 lines (42 loc) · 1.97 KB
/
Dockerfile_dev
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM golang:1.12-alpine as gobuilder
ENV GO111MODULE=on
RUN echo http://nl.alpinelinux.org/alpine/v3.6/main > /etc/apk/repositories; \
echo http://nl.alpinelinux.org/alpine/v3.6/community >> /etc/apk/repositories
RUN apk add --no-cache musl-dev git zeromq zeromq-dev libsodium-dev bash gcc
WORKDIR $GOPATH/src/github.com/intel/rsp-sw-toolkit-im-suite-food-safety-service
# Download go modules first so they can be cached for faster subsequent builds
COPY go.mod go.mod
RUN go mod download
COPY . .
RUN ./build.sh
FROM alpine:3.7 as builder
RUN echo http://nl.alpinelinux.org/alpine/v3.7/main > /etc/apk/repositories; \
echo http://nl.alpinelinux.org/alpine/v3.7/community >> /etc/apk/repositories
RUN apk --no-cache add zeromq curl
RUN mkdir -p /rootfs/curl
RUN for filename in $( \
ldd /usr/bin/curl \
# extract unqiue names
| grep -oE "/[^:]*" | awk '{print $1}' | sort -u); \
do \
cp -duv $filename `realpath $filename` --parents /rootfs/curl/; \
done
FROM alpine:3.7
# ZeroMQ libraries and dependencies
COPY --from=builder /lib/libc.musl-x86_64.so.1 /lib/
COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/
COPY --from=builder /usr/lib/libzmq.so.5.1.5 /usr/lib/
COPY --from=builder /usr/lib/libzmq.so.5 /usr/lib/
COPY --from=builder /usr/lib/libsodium.so.23 /usr/lib/
COPY --from=builder /usr/lib/libstdc++.so.6 /usr/lib/
COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/
COPY --from=builder /usr/lib/libcrypto.so.42 /usr/lib/
COPY --from=builder /usr/lib/libcrypto.so.42.0.0 /usr/lib/
# CURL libraries
COPY --from=builder /usr/bin/curl /usr/bin/
COPY --from=builder /rootfs/curl /
COPY --from=gobuilder /go/src/github.com/intel/rsp-sw-toolkit-im-suite-food-safety-service/food-safety-service /
COPY --from=gobuilder /go/src/github.com/intel/rsp-sw-toolkit-im-suite-food-safety-service/res/docker/ /res/docker
ARG GIT_COMMIT=unspecified
LABEL git_commit=$GIT_COMMIT
CMD ["/food-safety-service","-r","--profile=docker","--confdir=/res"]