forked from Mirantis/virtlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.build
63 lines (54 loc) · 2.18 KB
/
Dockerfile.build
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
61
62
63
FROM ubuntu:16.04
MAINTAINER Ivan Shvedunov <ishvedunov@mirantis.com>
LABEL Name="virtlet" Version="0.1"
# build container should be able to run libvirt because it's used for integration tests
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
make \
autoconf \
automake \
libglib2.0-dev \
libvirt-dev \
libguestfs-dev \
libguestfs0-dbg \
libguestfs-tools \
genisoimage \
p7zip-full \
iptables \
ebtables \
dhcpcd5 \
tcpdump \
iproute2 \
openssl \
qemu-kvm \
qemu-system-x86 \
libvirt-bin \
python-libvirt \
netbase \
iputils-ping \
mercurial && \
apt-get clean
# The following is based on official Go container:
# https://github.com/docker-library/golang/blob/18ee81a2ec649dd7b3d5126b24eef86bc9c86d80/1.7/Dockerfile
ENV GOLANG_VERSION 1.7.4
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 47fda42e46b4c3ec93fa5d4d4cc6a748aa3f9411a2a2b7e08e3a6d80d753ec8b
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz
ENV GOPATH /go
ENV PATH /go/src/github.com/Mirantis/virtlet/_output:$GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
RUN mkdir -p /go/src/github.com/Mirantis/virtlet
COPY . /go/src/github.com/Mirantis/virtlet
WORKDIR /go/src/github.com/Mirantis/virtlet
RUN mkdir -p ~/.ssh && \
ssh-keyscan github.com >> ~/.ssh/known_hosts && \
mkdir -p /var/data/virtlet /var/lib/virtlet /opt/cni/bin && \
curl -L https://github.com/containernetworking/cni/releases/download/v0.3.0/cni-v0.3.0.tgz | \
tar zxC /opt/cni/bin && \
ln -s /go/src/github.com/Mirantis/virtlet/_output/vmwrapper /vmwrapper
COPY image_skel /.