Skip to content

Commit

Permalink
aws: update building Dockerfile
Browse files Browse the repository at this point in the history
to use more modern version and adapt variables

Signed-off-by: Snir Sheriber <[email protected]>
  • Loading branch information
snir911 authored and Qi Feng Huo committed Aug 7, 2024
1 parent 3c88ae8 commit a579c2d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/cloud-api-adaptor/aws/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# Builds pod vm image inside container
#
# syntax=docker/dockerfile:1.3
ARG BUILDER_IMG="quay.io/confidential-containers/podvm-builder-ubuntu"
ARG BINARIES_IMG="quay.io/confidential-containers/podvm-binaries-ubuntu-amd64"
ARG RELEASE_TAG="v0.9.0"
ARG BUILDER_IMG="quay.io/confidential-containers/podvm-builder-ubuntu:${RELEASE_TAG}"
ARG BINARIES_IMG="quay.io/confidential-containers/podvm-binaries-ubuntu-amd64:${RELEASE_TAG}"

FROM ${BINARIES_IMG} AS podvm_binaries
FROM ${BUILDER_IMG} AS podvm_builder
Expand All @@ -15,8 +16,8 @@ ARG CLOUD_PROVIDER=aws
ARG PODVM_DISTRO=ubuntu
# If not provided, uses system architecture
ARG ARCH=x86_64
ARG CAA_SRC=""
ARG CAA_SRC_REF=""
ARG CAA_SRC="https://github.com/confidential-containers/cloud-api-adaptor"
ARG CAA_SRC_REF=${RELEASE_TAG}

ENV CLOUD_PROVIDER=${CLOUD_PROVIDER}
ENV PODVM_DISTRO=${PODVM_DISTRO}
Expand All @@ -32,19 +33,19 @@ RUN if [ -n "${CAA_SRC}" ]; then \
fi

# Copy the binaries to podvm/files folder
COPY --from=podvm_binaries /podvm-binaries.tar.gz /src/cloud-api-adaptor/podvm/files
COPY --from=podvm_binaries /podvm-binaries.tar.gz /src/cloud-api-adaptor/podvm/files/
RUN tar xvf /src/cloud-api-adaptor/podvm/files/podvm-binaries.tar.gz -C /src/cloud-api-adaptor/podvm/files

# Copy the pause_bundle to podvm/files folder
COPY --from=podvm_binaries /pause-bundle.tar.gz /src/cloud-api-adaptor/podvm/files
COPY --from=podvm_binaries /pause-bundle.tar.gz /src/cloud-api-adaptor/podvm/files/
RUN tar xvf /src/cloud-api-adaptor/podvm/files/pause-bundle.tar.gz -C /src/cloud-api-adaptor/podvm/files

ARG AWS_REGION
ARG VPC_ID
ARG SUBNET_ID
ARG INSTANCE_TYPE=t3.small
ARG IMAGE_NAME=peer-pod-ami
ARG VOL_SIZE
ARG VOLUME_SIZE=30

ENV AWS_REGION=${AWS_REGION}
ENV VPC_ID=${VPC_ID}
Expand All @@ -58,11 +59,10 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
unzip awscliv2.zip && \
./aws/install

RUN echo 1

RUN --mount=type=secret,id=AWS_ACCESS_KEY_ID \
--mount=type=secret,id=AWS_SECRET_ACCESS_KEY \
export AWS_ACCESS_KEY_ID=$(cat /run/secrets/AWS_ACCESS_KEY_ID) && \
export AWS_SECRET_ACCESS_KEY=$(cat /run/secrets/AWS_SECRET_ACCESS_KEY) && \
cd cloud-api-adaptor/aws/image && \
cd cloud-api-adaptor/src/cloud-api-adaptor/aws/image && \
BINARIES= PAUSE_BUNDLE= CLOUD_PROVIDER=aws PODVM_DISTRO=$PODVM_DISTRO make image

0 comments on commit a579c2d

Please sign in to comment.