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

4.2.1 in-cluster-configuration Dockerfile problem #12

Open
stevenlee87 opened this issue May 10, 2023 · 0 comments
Open

4.2.1 in-cluster-configuration Dockerfile problem #12

stevenlee87 opened this issue May 10, 2023 · 0 comments

Comments

@stevenlee87
Copy link

stevenlee87 commented May 10, 2023

我的集群是1.23.0版本

使用作者的Dockerfile发现了一些问题:
FROM busybox
COPY ./in-cluster /in-cluster
USER 65532:65532
ENTRYPOINT /in-cluster

执行kubectl run in-cluster -i --image=docker.io/in-cluster:v0.0.1 --restart=Never --overrides='{"spec": {"imagePullSecrets": [{"name": "image-pull-secret"}]}}'会报错:

pod default/in-cluster terminated (Error)

单从image的size上来说,busybox更小。不过busybox默认的libc实现是uClibc,而我们通常运行环境使用的libc实现都是glibc,因此我们要么选择静态编译程序,要么使用busybox:glibc镜像作为base image。

所以我把Dockerfile改为:
FROM busybox:glibc
WORKDIR /
COPY in-cluster .
ENTRYPOINT ["./in-cluster"]
就可以正常执行程序了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant