gpt4 book ai didi

Docker tini 没有这样的文件或目录

转载 作者:行者123 更新时间:2023-12-05 06:00:35 27 4
gpt4 key购买 nike

所以我有以下 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

我已经尝试用 dive 检查文件结构,一切正常。每个文件都被复制到它所属的位置..所以我认为这可能是 ENTRYPOINT 命令和 tini 的错误,因为 CMD 找到文件并运行它

这是潜水:Dive Results

最佳答案

我更新了您的COPYENTRYPOINT 命令。

尝试以下 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"]

关于Docker tini 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67620295/

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