-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 731 Bytes
/
Dockerfile
File metadata and controls
26 lines (18 loc) · 731 Bytes
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
FROM ubuntu:16.04 as build
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
ca-certificates \
wget \
rm -rf /var/lib/apt/lists/*
ENV GOLANG_VERSION 1.9.4
RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \
| tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
WORKDIR /go/src/cambricon-device-plugin
COPY . .
RUN export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
go install -ldflags="-s -w" -v cambricon-device-plugin
FROM debian:stretch-slim
COPY --from=build /go/bin/cambricon-device-plugin /usr/bin/cambricon-device-plugin
CMD ["cambricon-device-plugin"]