Skip to content

Commit

Permalink
add proxy cert in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
nianyush committed Oct 17, 2023
1 parent 6209156 commit a13e82b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
ARG BASE
ARG OS_DISTRIBUTION
ARG PROXY_CERT_PATH
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
FROM $BASE

COPY sc.crt /tmp/sc.crt

RUN if [ "$OS_DISTRIBUTION" = "ubuntu" ]; then \
if [ ! -z $PROXY_CERT_PATH ]; then \
cp /tmp/sc.crt /etc/ssl/certs && \
update-ca-certificates; \
fi \
elif [ "$OS_DISTRIBUTION" = "opensuse" ]; then \
if [ ! -z $PROXY_CERT_PATH ]; then \
cp /tmp/sc.crt /etc/ssl/certs && \
update-ca-certificates; \
fi \
fi

###########################Add any other image customizations here #######################

#### Examples ####
Expand Down
6 changes: 5 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ ARG RKE2_PROVIDER_VERSION=v2.3.3
ARG FIPS_ENABLED=false
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ARG http_proxy=${HTTP_PROXY}
ARG https_proxy=${HTTPS_PROXY}
ARG no_proxy=${NO_PROXY}
ARG PROXY_CERT_PATH
ARG UPDATE_KERNEL=false

Expand Down Expand Up @@ -205,7 +207,9 @@ kairos-provider-image:

# base build image used to create the base image for all other image types
base-image:
FROM DOCKERFILE --build-arg BASE=$BASE_IMAGE .
FROM DOCKERFILE --build-arg BASE=$BASE_IMAGE --build-arg PROXY_CERT_PATH=$PROXY_CERT_PATH \
--build-arg OS_DISTRIBUTION=$OS_DISTRIBUTION --build-arg HTTP_PROXY=$HTTP_PROXY --build-arg HTTPS_PROXY=$HTTPS_PROXY \
--build-arg NO_PROXY=$NO_PROXY .

# IF $IS_JETSON
# COPY mount.yaml /system/oem/mount.yaml
Expand Down

0 comments on commit a13e82b

Please sign in to comment.