在启动Docker容器之前删除文件

时间:2020-07-16 03:54:52

标签: docker docker-entrypoint

我正在使用此Graphite Docker Image,并且正在使用一个名为“ / entrypoint”的入口点,我认为没有其他命令:https://developer.android.com/guide/navigation/navigation-conditional

现在,我的目标是在每次启动容器时以及在脚本/ entrypoint运行之前删除特定文件。

我尝试使用--entrypoint "rm -f /opt/graphite/path/to/file; /entrypoint"覆盖默认入口点,但是随后容器始终始终在重新启动。结果是(泊坞窗检查):

[
    {
        "Id": "dcd0f2ba87fe3aae8089b40ea3e350c51750cb1cc2f890b066278e2cb52ce013",
        "Created": "2020-07-16T03:31:29.76953014Z",
        "Path": "rm",
        "Args": [
            "-f",
            "/opt/graphite/path/to/file;",
            "/entrypoint"
        ],
        "State": {
            "Status": "restarting",
...
...
...
...

在启动容器之前,您能帮我说出删除文件的正确方法吗?

提前谢谢!

0 个答案:

没有答案