@@ -18,17 +18,17 @@ function build_with_proxy() {
1818 --rm -t \
1919 -e GLOBAL_CONFIG=" $global_config " \
2020 -e BUILDKIT_TCP_TRANSPORT_ENABLED=true \
21- -e http_proxy=$HTTP_PROXY \
22- -e https_proxy=$HTTPS_PROXY \
23- -e HTTPS_PROXY=$HTTPS_PROXY \
24- -e HTTP_PROXY=$HTTP_PROXY \
25- -e NO_PROXY=$NO_PROXY \
26- -e no_proxy=$NO_PROXY \
27- -e EARTHLY_GIT_CONFIG=$gitconfig \
28- -v " $( pwd ) /certs :/usr/local/share/ca-certificates:ro" \
21+ -e http_proxy=" $HTTP_PROXY " \
22+ -e https_proxy=" $HTTPS_PROXY " \
23+ -e HTTPS_PROXY=" $HTTPS_PROXY " \
24+ -e HTTP_PROXY=" $HTTP_PROXY " \
25+ -e NO_PROXY=" $NO_PROXY " \
26+ -e no_proxy=" $NO_PROXY " \
27+ -e EARTHLY_GIT_CONFIG=" $gitconfig " \
28+ -v " $PROXY_CERT_PATH :/usr/local/share/ca-certificates/sc.crt :ro" \
2929 -v earthly-tmp:/tmp/earthly:rw \
3030 -p 8372:8372 \
31- $SPECTRO_PUB_REPO /third-party/edge/earthly/buildkitd:$EARTHLY_VERSION
31+ " $SPECTRO_PUB_REPO " /third-party/edge/earthly/buildkitd:$EARTHLY_VERSION
3232 # Update the CA certificates in the container
3333 docker exec -it earthly-buildkitd update-ca-certificates
3434
@@ -40,21 +40,21 @@ function build_with_proxy() {
4040 -e GLOBAL_CONFIG=" $global_config " \
4141 -e EARTHLY_BUILDKIT_HOST=tcp://0.0.0.0:8372 \
4242 -e BUILDKIT_TLS_ENABLED=false \
43- -e http_proxy=$HTTP_PROXY \
44- -e https_proxy=$HTTPS_PROXY \
45- -e HTTPS_PROXY=$HTTPS_PROXY \
46- -e HTTP_PROXY=$HTTP_PROXY \
47- -e NO_PROXY=$NO_PROXY \
48- -e no_proxy=$NO_PROXY \
43+ -e http_proxy=" $HTTP_PROXY " \
44+ -e https_proxy=" $HTTPS_PROXY " \
45+ -e HTTPS_PROXY=" $HTTPS_PROXY " \
46+ -e HTTP_PROXY=" $HTTP_PROXY " \
47+ -e NO_PROXY=" $NO_PROXY " \
48+ -e no_proxy=" $NO_PROXY " \
4949 -v " $( pwd) " :/workspace \
50- -v " $( pwd ) /certs:/usr/local/share/ca-certificates :ro" \
50+ -v " $PROXY_CERT_PATH :/workspace/sc.crt :ro" \
5151 --entrypoint /workspace/earthly-entrypoint.sh \
52- $SPECTRO_PUB_REPO /third-party/edge/earthly/earthly:$EARTHLY_VERSION --allow-privileged " $@ "
52+ " $SPECTRO_PUB_REPO " /third-party/edge/earthly/earthly:$EARTHLY_VERSION --allow-privileged " $@ "
5353}
5454
5555function build_without_proxy() {
5656 # Run Earthly in Docker to create artifacts Variables are passed from the .arg file
57- docker run --privileged -v ~ /.docker/config.json:/root/.docker/config.json -v /var/run/docker.sock:/var/run/docker.sock --rm --env EARTHLY_BUILD_ARGS -t -e GLOBAL_CONFIG=" $global_config " -v " $( pwd) " :/workspace $SPECTRO_PUB_REPO /third-party/edge/earthly/earthly:$EARTHLY_VERSION --allow-privileged " $@ "
57+ docker run --privileged -v ~ /.docker/config.json:/root/.docker/config.json -v /var/run/docker.sock:/var/run/docker.sock --rm --env EARTHLY_BUILD_ARGS -t -e GLOBAL_CONFIG=" $global_config " -v " $( pwd) " :/workspace " $SPECTRO_PUB_REPO " /third-party/edge/earthly/earthly:$EARTHLY_VERSION --allow-privileged " $@ "
5858}
5959
6060function print_os_pack() {
@@ -94,14 +94,6 @@ PE_VERSION=$(git describe --abbrev=0 --tags)
9494SPECTRO_PUB_REPO=us-docker.pkg.dev/palette-images
9595EARTHLY_VERSION=v0.8.15
9696source .arg
97-
98- # Workaround to support deprecated field PROXY_CERT_PATH
99- if [ -n " $PROXY_CERT_PATH " ]; then
100- echo " PROXY_CERT_PATH is deprecated. Please place your certificates in the certs directory."
101- echo " Copying the certificates from $PROXY_CERT_PATH to certs/"
102- cp $PROXY_CERT_PATH certs/
103- fi
104-
10597ALPINE_IMG=$SPECTRO_PUB_REPO /edge/canvos/alpine:3.20
10698# ## Verify Dependencies
10799# Check if Docker is installed
@@ -111,28 +103,28 @@ else
111103 echo " Docker not found. Please use the guide for your platform located https://docs.docker.com/engine/install/ to install Docker."
112104fi
113105# Check if the current user has permission to run privileged containers
114- if ! docker run --rm --privileged $ALPINE_IMG sh -c ' echo "Privileged container test"' & > /dev/null; then
106+ if ! docker run --rm --privileged " $ALPINE_IMG " sh -c ' echo "Privileged container test"' & > /dev/null; then
115107 echo " Privileged containers are not allowed for the current user."
116108 exit 1
117109fi
118- if [ -z " $HTTP_PROXY " ] && [ -z " $HTTPS_PROXY " ] && [ -z " $( find certs -type f ! -name ' .* ' -print -quit ) " ]; then
110+ if [ -z " $HTTP_PROXY " ] && [ -z " $HTTPS_PROXY " ]; then
119111 build_without_proxy " $@ "
120112else
121113 build_with_proxy " $@ "
122114fi
123115
124116# Verify the command was successful
125- if [ $? -ne 0 ] ; then
117+ if $? -ne 0 ; then
126118 echo " An error occurred while running the command."
127119 exit 1
128120fi
129121# Cleanup builder helper images.
130- docker rmi $SPECTRO_PUB_REPO /third-party/edge/earthly/earthly:$EARTHLY_VERSION
122+ docker rmi " $SPECTRO_PUB_REPO " /third-party/edge/earthly/earthly:$EARTHLY_VERSION
131123if [ " $( docker container inspect -f ' {{.State.Running}}' earthly-buildkitd) " = " true" ]; then
132124 docker stop earthly-buildkitd
133125fi
134- docker rmi $SPECTRO_PUB_REPO /third-party/edge/earthly/buildkitd:$EARTHLY_VERSION 2> /dev/null
135- docker rmi $ALPINE_IMG
126+ docker rmi " $SPECTRO_PUB_REPO " /third-party/edge/earthly/buildkitd:$EARTHLY_VERSION 2> /dev/null
127+ docker rmi " $ALPINE_IMG "
136128
137129if [[ " $1 " == " +uki-genkey" ]]; then
138130 ./keys.sh secure-boot/
0 commit comments