0

I'm using this Graphite Docker Image and it is using an entrypoint called "/entrypoint" and I think no additional command: https://hub.docker.com/r/graphiteapp/graphite-statsd/dockerfile

Now my goal is to delete a specific file everytime when the container starts and BEFORE the script /entrypoint is running.

I tried to override the default entrypoint with --entrypoint "rm -f /opt/graphite/path/to/file; /entrypoint", but then the container is always restarting the whole time. This is the result (docker inspect):

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

Can you help me telling the right way to delete a file before starting a container?

Thank you in advance!

  • 1
    I had a similar problem before and tried many times with overriding the default ENTRYPOINT. Then I found the solution is to build a custom Docker image on top of the original image. If you don't mind building your own custom Docker image then I can share it in an answer. – Duc Nguyen Jul 16 '20 at 04:06
  • 1
    @DucNguyen: I think building an own docker image from the original one is a good workaround, that you can share as an answer. I think I will give a try. – echomike Jul 16 '20 at 10:17

0 Answers0