douye1876 2019-03-15 18:08
浏览 776
已采纳

无法在Docker容器中执行二进制文件,但从主机执行

I have a docker container based on composer:1.8(based on php:7-alpine).

Inside the container I download a tar.gz via php, decompress it and extract it which works fine. This contains a Go binary I want to execute. When executing the binary inside the docker container I get this error message: ./bin/<binary>: No such file or directory. On my host machine I can execute this binary downloaded inside the docker container perfectly fine.

If it is important I start the docker container with: docker run -it --rm --volume=$PWD:/usr/src/myapp -u $(id -u):$(id -g) --name ec ec /bin/bash

I also tried to run readelf -a <binary> after installing it, but that doesn't have any effect.

bash-4.4$ ls -l <binary> && echo userid: $(id -u) && echo groupid: $(id -g) && uname -om && ./<binary>
-rwxr-xr-x    1 1000     985        7582050 Mar 15 17:09 <binary>
userid: 1000
groupid: 985
x86_64 Linux
bash: ./<binary>: No such file or directory

What can I do to make this work?

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥30 Dijkstra‘s 最短路径
      • ¥15 在线教育培训平台,主要以点播视频和在线练习测试为主,除将视频做切片外,有其他哪种方式降低流量?(关键词-带宽速率)
      • ¥20 用c语音或c++实现银行叫号系统
      • ¥15 人工智能 规则正向演绎和推理
      • ¥20 基于STM32F401的电子密码锁设计
      • ¥15 famamacbeth回归中遇到only size-1 arrays can be converted to Python scalars,求解答
      • ¥15 单片机多个自锁按键的编程实践
      • ¥15 用python操作redis存储中文后,再取出的数据变成了乱码怎么办?
      • ¥15 C语言简单排序问题有偿求解
      • ¥20 请问图片的代码什么意思