package icon indicating copy to clipboard operation
package copied to clipboard

F_Provide volume mounts for my code.

Open code4clouds opened this issue 7 years ago • 2 comments

As a cloud-developer, I would like mount a volume into my container, So I can use it with my uservice.

Ex. I would like to have a /data or /tmp directory on my container so my code can use to store some data.

code4clouds avatar Dec 14 '17 19:12 code4clouds

Sounds great, this would be an extension to the RuntimeConfig, please feel free to prototype and send PRs...

brendandburns avatar Dec 18 '17 19:12 brendandburns

I'll take a stab at this. I'm going to make some assumptions:

  • This only applies to the Docker executor for now
  • The requirements.txt must be in the image

So before I make a PR, I think the runtime options would look something like:

@Containerize(
    package={...}
    runtime={
        volumes={
            "/path/on/host": "/path/in/container",
            "/another/host/path": "/some/container/path:ro",     # <--- notice the ro annotation
        }
    }
)
def main():
...

Let me know what you think.

wagoodman avatar Apr 22 '18 12:04 wagoodman