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

docker-compose up -d 之后,ferry container重复报错 exec /opt/workflow/ferry/entrypoint.sh: no such file or directory #306

Open
acalephx opened this issue May 9, 2023 · 5 comments

Comments

@acalephx
Copy link

acalephx commented May 9, 2023

docker-compose up -d 之后,mysql和redis启动了,ferry container 重复重启,重复报错:

exec /opt/workflow/ferry/entrypoint.sh: no such file or directory

可是我从docker desktop的Files里,可以看到对应位置有这个文件entrypoint.sh 419 Bytes -rwxr-xr-x
我用命令 docker container cp ferry:/opt/workflow/ferry/entrypoint.sh D:\Downloads,也可以从ferry拷贝出文件,请问这个报错,可能是什么引起的?
使用的是matser( 829dc3a4ec54b01328f0853dbba768da7fbe320f)的代码

@acalephx
Copy link
Author

acalephx commented May 9, 2023

image

@acalephx
Copy link
Author

经查,这个image,缺少/opt/workflow/ferry/entrypoint.sh"这个文件,需要自己docker build

{
    "Id": "sha256:b7eb12d4f3a8f3117358dace701d242c9ad9c747de20134ff72835ef8b9a9ce1",
    "RepoTags": [
        "ferry:latest"
    ],
    "RepoDigests": [],
    "Parent": "sha256:b9925d5d0c02442110985bda5e000e957d94474e4dd1d9b2b5c38c9f95e93881",
    "Comment": "",
    "Created": "2023-05-10T05:34:45.000824696Z",
    "Container": "ad91d30b1ee552f4ea522cd9ade44b924cbdabd4e6e08c0e06bee5322bf2c3ee",
    "ContainerConfig": {
        "Hostname": "ad91d30b1ee5",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
            "8003/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
            "/bin/sh",
            "-c",
            "#(nop) ",
            "ENTRYPOINT [\"/opt/workflow/ferry/entrypoint.sh\"]"
        ],
        "Image": "sha256:b9925d5d0c02442110985bda5e000e957d94474e4dd1d9b2b5c38c9f95e93881",
        "Volumes": {
            "/opt/workflow/ferry/config": {}
        },
        "WorkingDir": "/opt/workflow/ferry",
        "Entrypoint": [
            "/opt/workflow/ferry/entrypoint.sh"
        ],
        "OnBuild": null,
        "Labels": {}
    },
    "DockerVersion": "20.10.21",
    "Author": "lanyulei",
    "Config": {
        "Hostname": "",
        "Domainname": "",
        "User": "",
        "AttachStdin": false,
        "AttachStdout": false,
        "AttachStderr": false,
        "ExposedPorts": {
            "8003/tcp": {}
        },
        "Tty": false,
        "OpenStdin": false,
        "StdinOnce": false,
        "Env": [
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": null,
        "Image": "sha256:b9925d5d0c02442110985bda5e000e957d94474e4dd1d9b2b5c38c9f95e93881",
        "Volumes": {
            "/opt/workflow/ferry/config": {}
        },
        "WorkingDir": "/opt/workflow/ferry",
        "Entrypoint": [
            "/opt/workflow/ferry/entrypoint.sh"
        ],
        "OnBuild": null,
        "Labels": null
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Size": 148417960,
    "VirtualSize": 148417960,
    "GraphDriver": {
        "Data": {
            "LowerDir": "/var/lib/docker/overlay2/878c3905eb0b0102604abb2e0028d0283ac9920a4c967a30f42e14fe64c1d657/diff:/var/lib/docker/overlay2/16a639d733f2278d19ea84c8ff43c94af5a0ec00110c1d377e05d49929254aba/diff:/var/lib/docker/overlay2/6e8a191c7c510ee9bcbbf64b1c2691def8e0316576475f78374d47584ee00d05/diff:/var/lib/docker/overlay2/e98a1646bb8b5dba963b36fb20c50143b4cb007ad4709ad32b962e0f116a58db/diff:/var/lib/docker/overlay2/9be01ada38dd4d945dfe7f27a4db0573b4bc18952cdacfc9794f6489d143b5ad/diff:/var/lib/docker/overlay2/860433fac8a2a12d233f4e8daf31c80cbcaa10837453aa21510910ba4470958a/diff:/var/lib/docker/overlay2/690049f747d9fcb4d9f304288be70ea8d635a1f974f14ae0cc5cf3f43d531c34/diff:/var/lib/docker/overlay2/cfba5aaa7e2d696d119916c839a705943738f4c85c57c0c0bc9cd2f5cb83a2bd/diff:/var/lib/docker/overlay2/a9d7161510ac9e480a12c8be1400a563cd17df2d93ce051191aa399d23411daa/diff:/var/lib/docker/overlay2/78260279e1b3fd49e24d02c7d66486b3bbe513108eb19cbfeaef43e52b4cb7c1/diff:/var/lib/docker/overlay2/14ae517d264998ac181f9883d8ccf3777b7c952e0bb7ad1902e84ba06c3cf25a/diff:/var/lib/docker/overlay2/34904053fbff00d5705e93f1f9d26738c7b869a43e79e08513ae34cbb4dbad03/diff:/var/lib/docker/overlay2/c8b277d8c18529780b2a69dce3677a2056aa09ec3882f7f53f18c4c82a03a817/diff",
            "MergedDir": "/var/lib/docker/overlay2/305557c11a4b9ab6c8b743fc803d1ed9993d9daf9c24d1106f3443c9aafdf16e/merged",
            "UpperDir": "/var/lib/docker/overlay2/305557c11a4b9ab6c8b743fc803d1ed9993d9daf9c24d1106f3443c9aafdf16e/diff",
            "WorkDir": "/var/lib/docker/overlay2/305557c11a4b9ab6c8b743fc803d1ed9993d9daf9c24d1106f3443c9aafdf16e/work"
        },
        "Name": "overlay2"
    },
    "RootFS": {
        "Type": "layers",
        "Layers": [
            "sha256:bb01bd7e32b58b6694c8c3622c230171f1cec24001a82068a8d30d338f420d6c",
            "sha256:3f918b92e285727a24e8fb416a410f1cb95a20c66fa46d411cc25f22fd5f59f2",
            "sha256:6a4fd688ab94a2671fd7fbc8efdaafe37513e59e755c229c64e383639886ef9e",
            "sha256:f0eadbd218bd65082222653716907a3b4242a9f363a536521419a0e34d6b07e6",
            "sha256:9109a391c28172d30a99ebb8701b5bd4e385bf84486f90862e906fc27645dc86",
            "sha256:66897b6d32893e9fc65d1b5431607dac9c826b9e9cd5b7745c63ae21f85f5245",
            "sha256:8f96c9456ff39ceef97202f7e63cd99034d7041f3937715bad9fe45cf954533c",
            "sha256:f9adff3720de8be95cf0173243b54fa164af6d626bce2a697113d9fa99da0efd",
            "sha256:39483edca0d648503a2620ab3aa5ed33b5b632e35b1e51f5bc1a2e79dfd6af89",
            "sha256:627f94728c54120baf1422caa5786b9a0bcd56180fe6f74e09b59c49af799e4f",
            "sha256:81b72381bd64ed1030f7117df1db34798954c014b6640f056f36ab98a0fece7b",
            "sha256:a6481beeae8dd66a9f40cc7b663caa02629a16e6d0abaa3d91f363cabfd06cd1",
            "sha256:f8ecf680efdf2bc050831ab45d1e3fb77c853e5f6d301c7bef8cd0c70c97c94d",
            "sha256:88ff145ee5aa3edc3272a161fc8b97d534f2c4ccd85091e61d1b28ec785f80aa"
        ]
    },
    "Metadata": {
        "LastTagTime": "2023-05-10T13:34:45.196561917+08:00"
    }
}

@acalephx
Copy link
Author

@lanyulei

@gimebreak
Copy link

奇怪 再linux下面直接docker-compose 就启动了。但是在windows下面也是报这错。 而且dockerfile里面有copy entrypoint.sh的指令啊。

@toolatetosleep
Copy link

研究了一下,导致【exec ./entrypoint.sh: no such file or directory】错误的原因是:docker/entrypoint.sh 是windows格式文件,linux系统无法识别执行。解决方法:1、使用linux命令dos2unix filename,直接把文件转换为unix格式. 2、vi filename打开文件,执行 : set ff=unix 设置文件为unix,然后执行:wq,保存成unix格式。 最后,需要重新生成镜像【docker compose up -d --build】
可以通过以下方式,查看验证 dos格式的文件行尾为^M$,unix格式的文件行尾为$
cat -A docker/entrypoint.sh

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

3 participants