Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-2796 add proxy cert in dockerfile #78

Merged
merged 15 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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=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
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