forked from solo-io/packer-plugin-arm-image
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
40 lines (31 loc) · 1.05 KB
/
Dockerfile
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
FROM golang:buster AS builder
RUN apt-get update -qq \
&& apt-get install -qqy git && \
mkdir /build
WORKDIR /build
# if you wish to build from upstream, un comment this line, and comment lines below
# RUN git clone --depth 1 https://github.com/solo-io/packer-builder-arm-image /build
# if you wish to build from upstream, comment from here.
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# if you wish to build from upstream, comment up to here.
RUN go build -o packer-builder-arm-image
FROM ubuntu:focal
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -qqy \
qemu-user-static \
kpartx \
unzip \
wget \
curl \
sudo \
&& rm -rf /var/lib/apt/lists/*
ENV PACKER_VERSION 1.6.0
RUN wget https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip -O /tmp/packer.zip && \
unzip /tmp/packer.zip -d /bin && \
rm /tmp/packer.zip
WORKDIR /build
COPY entrypoint.sh /entrypoint.sh
COPY --from=builder /build/packer-builder-arm-image /bin/packer-builder-arm-image
ENTRYPOINT ["/entrypoint.sh"]