Skip to content

Commit

Permalink
[v410-alpha1] PE-2796 add proxy cert in dockerfile (#78) (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 18, 2023
1 parent 1261b0a commit a2116c7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
21 changes: 18 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
ARG BASE
FROM $BASE

ARG OS_DISTRIBUTION
ARG PROXY_CERT_PATH
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY

COPY sc.crt /tmp/sc.crt
RUN if [ "${OS_DISTRIBUTION}" = "ubuntu" ] && [ "${PROXY_CERT_PATH}" != "" ]; then \
cp /tmp/sc.crt /etc/ssl/certs && \
update-ca-certificates; \
fi
RUN if [ "${OS_DISTRIBUTION}" = "opensuse-leap" ] && [ "${PROXY_CERT_PATH}" != "" ]; then \
cp /tmp/sc.crt /usr/share/pki/trust/anchors && \
update-ca-certificates; \
fi

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

#### Examples ####

### To install the nginx package for Ubuntu ###

#RUN apt-get update && apt-get install nginx -y

# RUN apt-get update && apt-get install nginx -y
### or

### To install the nginx package for opensuse ###

#RUN zypper refresh && zypper install nginx -y
# RUN zypper refresh && zypper install nginx -y
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=v4.1.0-alpha2
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 @@ -204,7 +206,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
3 changes: 3 additions & 0 deletions earthly.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
# Uncomment the line below to enable debug mode
# set -x

function build_with_proxy() {
export HTTP_PROXY=$HTTP_PROXY
export HTTPS_PROXY=$HTTPS_PROXY
Expand Down

0 comments on commit a2116c7

Please sign in to comment.