dpb56083 2019-06-06 11:59
浏览 147
已采纳

sh:./bc2influx:在停止的容器中进入时找不到

I have an issue when running a docker container.

➜  bc_to_influx git:(master) ✗ docker run registry.gitlab.com/xxx/bc_to_influx:latest
standard_init_linux.go:207: exec user process caused "no such file or directory"

When I debug, I enter in the stopped container:

docker commit 0db73216baaf  user/test_image 
docker run -ti --entrypoint=sh user/test_image

on ls command, I can only my executable:

/bc2influx # ls -al
total 20552
drwxr-xr-x    1 root     root          4096 Jun  6 10:32 .
drwxr-xr-x    1 root     root          4096 Jun  6 11:53 ..
-rwxr-xr-x    1 root     root      21034520 Jun  6 10:29 bc2influx
/bc2influx # 

but when I try to execute, I get:

/bc2influx # ./bc2influx 
sh: ./bc2influx: not found

I can vi, cat the execute, but not execute it

here is my Dockerfile

FROM alpine

WORKDIR /bc2influx/
COPY ./release/bc2influx /bc2influx/
RUN ls -al /bc2influx/
CMD [ "./bc2influx" ]

I previously build my executable with:

go build -o ./release/bc2influx -v -ldflags '-extldflags "-static"' ./...

Any idea what's going on ?

  • 写回答

1条回答 默认 最新

  • dpgvdfg321041670 2019-06-06 13:07
    关注

    Looks like musl library issue try this build command go build -ldflags="-s -w".

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 已有python代码,要求做成可执行程序,程序设计内容不多
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥15 小红薯封设备能解决的来
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答
  • ¥20 在本地部署CHATRWKV时遇到了AttributeError: 'str' object has no attribute 'requires_grad'
  • ¥15 vue+element项目中多tag时,切换Tab时iframe套第三方html页面需要实现不刷新
  • ¥50 深度强化学习解决能源调度问题