1 Star 0 Fork 0

mamh-mixed/ks-installer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile.complete 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
Mohamed Rafraf 提交于 2024-02-14 08:56 . Controller Refactoring
FROM golang:1.17-alpine
ARG appVersion=latest
RUN apk --no-cache add git ca-certificates && \
git clone --branch v1.0.0-beta.5 https://github.com/flant/shell-operator.git /go/src/github.com/flant/shell-operator
RUN go get -d github.com/flant/shell-operator/...
WORKDIR /go/src/github.com/flant/shell-operator
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X 'github.com/flant/shell-operator/pkg/app.Version=$appVersion'" -o shell-operator ./cmd/shell-operator
FROM python:3.10-alpine
ENV ARCH=amd64
RUN apk --no-cache add jq yq bash curl unzip openssl && \
apk --no-cache add gcc libffi-dev openssl-dev musl-dev && \
export CRYPTOGRAPHY_DONT_BUILD_RUST=1 && \
pip install --no-cache-dir ansible_runner==2.2.0 ansible==2.9.27 kubernetes --use-deprecated=legacy-resolver && \
apk del gcc libffi-dev openssl-dev musl-dev && \
if [[ $(arch) == aarch64* ]]; then ARCH=arm64; fi && \
wget https://get.helm.sh/helm-v3.9.0-linux-${ARCH}.tar.gz && \
tar -zxf helm-v3.9.0-linux-${ARCH}.tar.gz && \
mv linux-${ARCH}/helm /bin/helm && \
rm -rf *linux-${ARCH}* && \
chmod +x /bin/helm && \
wget https://storage.googleapis.com/kubernetes-release/release/v1.23.7/bin/linux/${ARCH}/kubectl -O /bin/kubectl && \
chmod +x /bin/kubectl && \
ln -s /bin/kubectl /usr/local/bin/kubectl && \
ln -s /bin/helm /usr/local/bin/helm && \
mkdir -p /hooks/kubesphere /kubesphere/installer/roles /kubesphere/results/env /kubesphere/playbooks /kubesphere/config &&\
adduser -D -g kubesphere -u 1002 kubesphere
COPY --from=0 /go/src/github.com/flant/shell-operator/shell-operator /
COPY controller/ /hooks/kubesphere/
RUN chown -R kubesphere:kubesphere /shell-operator && \
chown -R kubesphere:kubesphere /hooks && \
chown -R kubesphere:kubesphere /kubesphere && \
chmod +x /hooks/kubesphere/installRunner.py
USER kubesphere
ENV SHELL_OPERATOR_WORKING_DIR /hooks
ENV ANSIBLE_ROLES_PATH /kubesphere/installer/roles
WORKDIR /kubesphere
ADD roles /kubesphere/installer/roles
ADD env /kubesphere/results/env
ADD playbooks /kubesphere/playbooks
ENTRYPOINT ["/shell-operator"]
CMD ["start"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mamh-mixed/ks-installer.git
git@gitee.com:mamh-mixed/ks-installer.git
mamh-mixed
ks-installer
ks-installer
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385