[英]Sh : file not found on alpine Docker image
I installed Docker on my Raspberry Pi3. 我在Raspberry Pi3上安装了Docker。 I want to install the "registry" image.
我要安装“注册表”映像。 As I do not find it in ARM, I have built an AMR version.
由于我在ARM中找不到它,因此我构建了AMR版本。
I recompiled the binary from the git https://github.com/docker/distribution/ 我从git https://github.com/docker/distribution/重新编译了二进制文件
I get a functional binary: 我得到一个功能二进制文件:
# registry --version
src_docker/go/bin/registry github.com/docker/distribution v2.6.0+unknown
Then I left the git https://github.com/docker/distribution-library-image to customize the Dockerfile. 然后我离开了git https://github.com/docker/distribution-library-image以自定义Dockerfile。
FROM arm32v6/alpine:3.5
RUN set -ex \
&& apk add --no-cache ca-certificates apache2-utils
COPY ./registry/registry /bin/registry
COPY ./registry/config-example.yml /etc/docker/registry/config.yml
VOLUME ["/var/lib/registry"]
EXPOSE 5000
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/etc/docker/registry/config.yml"]
I have of course to replace the "registry / registry" by the binary that I compiled. 我当然要用我编译的二进制文件替换“注册表/注册表”。
I build image : 我建立形象:
docker build . -t ikise_arm/registry
But when I execute the image it does not find the binary 但是当我执行图像时,找不到二进制文件
# docker run -ti ikise_arm/registry:latest
/entrypoint.sh: exec: line 10: registry: not found
If I disable the ENTRYPOINT and explore the files I find the biary but impossible to execute 如果我禁用ENTRYPOINT并浏览文件,我会找到二进制文件,但无法执行
# docker run -ti ikise_arm/registry:latest
/ # ls -al /bin/r*
lrwxrwxrwx 1 root root 12 Mar 2 20:19 /bin/reformime -> /bin/busybox
-rwxr-xr-x 1 root root 19940588 Jun 14 12:27 /bin/registry
lrwxrwxrwx 1 root root 12 Mar 2 20:19 /bin/rev -> /bin/busybox
lrwxrwxrwx 1 root root 12 Mar 2 20:19 /bin/rm -> /bin/busybox
lrwxrwxrwx 1 root root 12 Mar 2 20:19 /bin/rmdir -> /bin/busybox
lrwxrwxrwx 1 root root 12 Mar 2 20:19 /bin/run-parts -> /bin/busybox
/ # /bin/registry
sh: /bin/registry: not found
Do you have any idea where the problem may come from? 您是否知道问题可能来自何处?
So I adapted the image https://github.com/docker-library/golang/tree/master/1.8/alpine3.6 To compile the binary registry 所以我修改了图像https://github.com/docker-library/golang/tree/master/1.8/alpine3.6编译二进制注册表
( https://github.com/gliderlabs/docker-alpine/issues/78 ) ( https://github.com/gliderlabs/docker-alpine/issues/78 )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.