如何解决Docker tini 没有这样的文件或目录
所以我有以下 Dockerfile:
FROM ubuntu:latest
WORKDIR /vault
COPY run.sh /vault/run.sh
COPY docker-entrypoint.sh /vault/docker-entrypoint.sh
COPY config/local.json /vault/config/local.json
COPY logs /vault/logs
COPY file /vault/file
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN chmod +x /vault/run.sh
RUN chmod 777 /vault/docker-entrypoint.sh
RUN apt-get update && apt-get install -y software-properties-common curl gnupg2 && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \
apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
apt-get update && apt-get install -y \
vault bash && \
setcap cap_ipc_lock= /usr/bin/vault
ENTRYPOINT ["/tini","--","/vault/docker-entrypoint.sh"]
#CMD ["sh","/vault/run.sh"]
文件结构为:
-docker-vault (dir)
|-Dockerfile (file)
|-docker-entrypoint.sh (file)
|-run.sh
|- file (dir)
|- logs (dir)
|- config (dir)
|- local.json
运行 dockerfile 时出现以下错误:
[FATAL tini (8)] exec /vault/docker-entrypoint.sh failed: No such file or directory
我已经尝试用潜水检查文件结构,一切都很好。每个文件都被复制到它所属的地方..所以我认为这可能是 ENTRYPOINT 命令和 tini 的错误,因为 CMD 找到该文件并运行它
解决方法
我更新了您的 COPY
和 ENTRYPOINT
命令。
尝试以下 Dockerfile:
FROM ubuntu:latest
WORKDIR /vault
COPY ./run.sh ./run.sh
COPY ./docker-entrypoint.sh ./docker-entrypoint.sh
COPY ./config/local.json ./config/local.json
COPY ./logs ./logs
COPY ./file ./file
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN chmod +x run.sh
RUN chmod 777 docker-entrypoint.sh
RUN apt-get update && apt-get install -y software-properties-common curl gnupg2 && \
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \
apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
apt-get update && apt-get install -y \
vault bash && \
setcap cap_ipc_lock= /usr/bin/vault
ENTRYPOINT ["/tini","--","bash","/vault/docker-entrypoint.sh"]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。