Alpine容器安装Docker和OpenShift Client Tools

安装Docker

echo "http://dl-2.alpinelinux.org/alpine/edge/main" > /etc/apk/repositories
echo "http://dl-2.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
echo "http://dl-2.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

apk -U --no-cache \
	--allow-untrusted add \
	shadow \
    docker \
    py-pip \
    openrc \
    && pip install docker-compose
    
rc-update add docker boot

安装OpenShift Client Tools

需要先安装glibc

apk --no-cache add ca-certificates wget
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk
apk add glibc-2.28-r0.apk

curl --retry 7 -Lo /tmp/client-tools.tar.gz "https://mirror.openshift.com/pub/openshift-v3/clients/3.9.1/linux/oc.tar.gz"

curl --retry 7 -Lo /tmp/client-tools.tar.gz "https://mirror.openshift.com/pub/openshift-v3/clients/3.9.1/linux/oc.tar.gz"

tar zxf /tmp/client-tools.tar.gz -C /usr/local/bin oc \
    && rm /tmp/client-tools.tar.gz \
    && apk del .build-deps
    
# ADDED: Resolve issue x509 oc login issue
apk add --update ca-certificates

参考: github issue

comments powered by Disqus