-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.podvm_builder
53 lines (42 loc) · 2.27 KB
/
Dockerfile.podvm_builder
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
# syntax=docker/dockerfile:1.5-labs
# Copyright Confidential Containers Contributors
#
# SPDX-License-Identifier: Apache-2.0
#
# Creates a builder container image that should be used to build the Pod VM
# disk inside a container.
#
FROM ubuntu:20.04
ARG GO_VERSION
ARG PROTOC_VERSION
ARG RUST_VERSION
ARG YQ_VERSION
ARG YQ_CHECKSUM
# Without setting ENV gh-action is failing to use the correct values
ENV GO_VERSION ${GO_VERSION}
ENV RUST_VERSION ${RUST_VERSION}
ENV PROTOC_VERSION ${PROTOC_VERSION}
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y && \
apt-get install --no-install-recommends -y build-essential cloud-image-utils curl git gnupg \
libdevmapper-dev libgpgme-dev lsb-release pkg-config qemu-kvm \
musl-tools unzip wget git && \
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-17 main" | tee -a /etc/apt/sources.list && \
apt-get update && apt-get install -y clang-17 && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \
echo "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee -a /etc/apt/sources.list && \
apt-get update && apt-get install --no-install-recommends -y packer=1.9.4-1 && \
apt-get clean
ADD https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz go${GO_VERSION}.linux-amd64.tar.gz
RUN rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm -f go${GO_VERSION}.linux-amd64.tar.gz
ADD --checksum=${YQ_CHECKSUM} https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 /usr/local/bin/yq
RUN chmod a+x /usr/local/bin/yq
ENV PATH "/root/.cargo/bin:/usr/local/go/bin:$PATH"
ADD https://sh.rustup.rs rustup
RUN chmod a+x rustup && ./rustup -y --default-toolchain ${RUST_VERSION} \
&& rustup target add x86_64-unknown-linux-musl && ln -sf /usr/bin/g++ /bin/musl-g++
ADD https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip protoc-${PROTOC_VERSION}-linux-x86_64.zip
RUN unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local && rm -f protoc-${PROTOC_VERSION}-linux-x86_64.zip
WORKDIR /src
ENV GOPATH /src