gpt4 book ai didi

bash - 由于docker中.sh文件的权限被拒绝,travis测试失败

转载 作者:行者123 更新时间:2023-12-02 20:01:27 25 4
gpt4 key购买 nike

我正在尝试让travis与我的容器 flask 应用程序一起使用。在本地构建和提交时一切正常,我在此命令上失败:

docker-compose -f docker-compose-dev.yml up --build -d

这是我从特拉维斯的错误:
Successfully built e5cc5b91a3ee
Successfully tagged testdriven-app_nginx:latest
Creating testdriven-app_users-db_1 ...
ERROR: for testdriven-app_users_1 Cannot start service users: oci runtime error: container_linux.go:265: starting container process caused "exec: \"/usr/src/app/entrypoint.sh\": permission denied"
ERROR: for users Cannot start service users: oci runtime error: container_linux.go:265: starting container process caused "exec: \"/usr/src/app/entrypoint.sh\": permission denied"
ERROR: Encountered errors while bringing up the project.
The command "sudo docker-compose -f docker-compose-dev.yml up --build -d" failed and exited with 1 during .

这是我的travis yml文件,我在之前的脚本部分中失败了:
sudo: required

services:
- docker

env:
DOCKER_COMPOSE_VERSION: 1.21.1

before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

before_script:
- docker-compose -f docker-compose-dev.yml up --build -d

script:
- docker-compose -f docker-compose-dev.yml run users python manage.py test
- docker-compose -f docker-compose-dev.yml run users python flake8 project

after_script:
- docker-compose -f docker-compose-dev.yml down

我在docker compose上使用了chmod,据我了解,这应该给了我该文件的权限。

任何帮助将非常感激!

最佳答案

我从更改了dockerprofile

CMD["/usr/src/app/entrypoint.sh"]


RUN ["chmod","+x","/usr/src/app/entrypoint.sh"]

解决了问题

关于bash - 由于docker中.sh文件的权限被拒绝,travis测试失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53253207/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com