root@docker-01:~# file server
server: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=016df6500c2c3df1dd3ce82d9e9a5bd547584c97, for GNU/Linux 3.2.0, with debug_info, not stripped
The <src> path must be inside the build context; you can't use COPY ../something /something, because the builder can only access files from the context, and ../something specifies a parent file or directory of the build context root.
使用 docker run -p 8080:8080 --name status-checker tmp
curl localhost:8080 报错
tls: failed to verify certificate: x509: certificate signed by unknown authority
exec /server: no such file or directory
cp
来复制二进制 server 文件到本地运行,没有报错 (8080 端口)docker cp status-checker:/server .
file
和ldd
来查看文件动态链接的 so 文件docker build -t tmp .
build 的时候
COPY
出现无文件的错误文件必须和 dockerfile 文件的同级目录下 ^2
docker run -p 8080:8080 --name status-checker tmp
curl localhost:8080
报错tls: failed to verify certificate: x509: certificate signed by unknown authority
ca-certificates