Skip to content

Commit 142a718

Browse files
authored
Merge pull request #165 from thedadams/rancher-cert-fixes
Allow machine to trust Rancher certs
2 parents 74d5458 + 9324ada commit 142a718

3 files changed

Lines changed: 25 additions & 19 deletions

File tree

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
TARGETS := $(shell ls scripts)
22

33
.dapper:
4-
@echo Downloading dapper
5-
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
6-
@@chmod +x .dapper.tmp
7-
@./.dapper.tmp -v
8-
@mv .dapper.tmp .dapper
4+
@if [[ `uname -s` = "Darwin" && `uname -m` = "arm64" ]]; then\
5+
echo "Dapper download is not supported on ARM Macs, you need to build it and add it as .dapper in this directory";\
6+
exit 0;\
7+
fi;\
8+
echo Downloading dapper;\
9+
curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp;\
10+
chmod +x .dapper.tmp;\
11+
./.dapper.tmp -v;\
12+
mv .dapper.tmp .dapper;
913

1014
$(TARGETS): .dapper
1115
./.dapper $@

package/Dockerfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
1+
FROM registry.suse.com/suse/sle15:15.3
22

3-
RUN microdnf update -y && \
4-
microdnf install unzip file tar gzip openssh-clients && \
5-
rm -rf /var/cache/yum
3+
ENV SSL_CERT_DIR /etc/rancher/ssl
4+
5+
RUN zypper -n update && \
6+
zypper -n install git-core curl ca-certificates unzip xz gzip sed tar && \
7+
zypper -n clean -a && \
8+
rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/*
69

710
RUN useradd -u 1000 machine
811

9-
RUN mkdir -p .docker/machine/machines
12+
RUN mkdir -p .docker/machine/machines /etc/rancher/ssl /home/machine && \
13+
chown -R machine /etc/rancher/ssl && \
14+
chown -R machine /home/machine
1015

1116
COPY download_driver.sh /usr/local/bin/
1217
RUN chmod +x /usr/local/bin/download_driver.sh
1318

14-
RUN download_driver.sh "https://github.com/linode/docker-machine-driver-linode/releases/download/v0.1.8/docker-machine-driver-linode_linux-amd64.zip" "b31b6a504c59ee758d2dda83029fe4a85b3f5601e22dfa58700a5e6c8f450dc7"
15-
RUN download_driver.sh "https://drivers.rancher.cn/node-driver-pinganyun/0.3.0/docker-machine-driver-pinganyunecs-linux.tgz" "f84ccec11c2c1970d76d30150916933efe8ca49fe4c422c8954fc37f71273bb5"
16-
RUN download_driver.sh "https://github.com/cloud-ca/docker-machine-driver-cloudca/files/2446837/docker-machine-driver-cloudca_v2.0.0_linux-amd64.zip" "1757e2b807b0fea4a38eade4e961bcc609853986a44a99a4e86a37ccea1f7679"
17-
RUN download_driver.sh "https://github.com/cloudscale-ch/docker-machine-driver-cloudscale/releases/download/v1.2.0/docker-machine-driver-cloudscale_v1.2.0_linux_amd64.tar.gz" "e33fbd6c2f87b1c470bcb653cc8aa50baf914a9d641a2f18f86a07c398cfb544"
18-
RUN download_driver.sh "https://github.com/rancher-plugins/rancher-machine-driver-oci/releases/download/v1.0.1/docker-machine-driver-oci-linux" "6867f59e9f33bdbce34b5bf9476c48d2edc2ef4bca8a2ef82ccaa1de57af811c"
19-
RUN download_driver.sh "https://github.com/rancher-plugins/docker-machine-driver-otc/releases/download/v2019.5.7/docker-machine-driver-otc" "a2cc921a64e6192d8036afdf07f13f0c8459fc4932d1cfb183efccfac7baea04"
20-
RUN download_driver.sh "https://github.com/packethost/docker-machine-driver-packet/releases/download/v0.2.2/docker-machine-driver-packet_linux-amd64.zip" "e03c6bc9406c811e03e9bc2c39f43e6cc8c02d1615bd0e0b8ee1b38be6fe201c"
21-
RUN download_driver.sh "https://github.com/phoenixnap/docker-machine-driver-pnap/releases/download/v0.1.0/docker-machine-driver-pnap_0.1.0_linux_amd64.zip" "5f25a7fbcaca0710b7290216464ca8433fa3d683b59d5e4e674bef2d0a3ff6c7"
22-
2319
COPY rancher-machine entrypoint.sh /usr/local/bin/
2420
RUN chmod 0777 /usr/local/bin
2521

package/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
set -e
33
termination_log="/dev/termination-log"
44

5+
if [ -x "$(command -v c_rehash)" ]; then
6+
# c_rehash is run here instead of update-ca-certificates because the latter requires root privileges
7+
# and the rancher-machine container is run as non-root user.
8+
c_rehash
9+
fi
10+
511
for i; do
612
shift
713
case $i in

0 commit comments

Comments
 (0)