Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Use golang and amazonlinux as base image (#2)
Browse files Browse the repository at this point in the history
1. Use golang base image directly instead of download binary
2. Use amazonlinux base image as it’s preapproved internally.

Signed-off-by: Jiaxin Shan <[email protected]>
  • Loading branch information
Jeffwan authored Mar 3, 2020
1 parent 01f757d commit 3ff8247
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:16.04 as build

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
git \
ca-certificates \
wget && \
rm -rf /var/lib/apt/lists/*

ENV GOLANG_VERSION 1.12.3
RUN wget -nv -O - https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \
| tar -C /usr/local -xz

ENV GO111MODULE on
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
FROM golang:1.13 as build

ENV GOPROXY direct
WORKDIR /go/src/github.com/awslabs/aws-virtual-gpu-device-plugin
COPY . .

RUN export CGO_LDFLAGS_ALLOW='-Wl,--unresolved-symbols=ignore-in-object-files' && \
go build -ldflags="-s -w" -o vgpu-device-plugin main.go
go build -ldflags="-s -w" -o virtual-gpu-device-plugin main.go


FROM debian:stretch-slim
FROM amazonlinux:latest

ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=utility

COPY --from=build /go/src/github.com/awslabs/aws-virtual-gpu-device-plugin/vgpu-device-plugin /usr/bin/vgpu-device-plugin
COPY --from=build /go/src/github.com/awslabs/aws-virtual-gpu-device-plugin/virtual-gpu-device-plugin /usr/bin/virtual-gpu-device-plugin

CMD ["vgpu-device-plugin"]
CMD ["virtual-gpu-device-plugin"]

0 comments on commit 3ff8247

Please sign in to comment.