-
Notifications
You must be signed in to change notification settings - Fork 463
/
Copy pathDockerfile_glibc
34 lines (25 loc) · 904 Bytes
/
Dockerfile_glibc
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
# Building Libvirt Plugin Docker
FROM golang:stretch
ARG VERSION
ENV VERSION=$VERSION
# Install Needed Packages
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install \
-y --no-install-recommends \
git make pkg-config gcc libc-dev libvirt-dev \
&& rm -rf /var/lib/apt/lists/*
# Pull Go lint for building
RUN go get -u golang.org/x/lint/golint
# Make directory
RUN mkdir -p $GOPATH/src/github.com/dmacvicar/
# Set Work Directory for Clone
WORKDIR $GOPATH/src/github.com/dmacvicar/
# Clone Project
RUN git clone https://github.com/dmacvicar/terraform-provider-libvirt.git
# Set Workdir for bin build
WORKDIR $GOPATH/src/github.com/dmacvicar/terraform-provider-libvirt
# Checkout Version and download go dependencies
RUN git checkout $VERSION && env GO111MODULE=on go mod download
# Build and move the Binary
RUN make build && mv terraform-provider-libvirt $GOPATH/bin/