Reputation: 332
I have a docker image that requires post-build configuration files to work. These are normally placed on a host directory that is mounted in the container, i.e., docker run -v /src/config:/usr/local/config ...
Can this be done on Bluemix as well? i.e., create a volume, upload files and then start the container?
Upvotes: 0
Views: 345
Reputation: 1220
Bluemix does have recommended approaches for adding files to a volume.
To summarize, two methods are suggested:
(1) Use wget
inside the container (cf ic exec
) once the container is started to download data onto the volume mount folder.
(2) Add the files as part of the image build, and create a container startup script that copies files from a folder in the container to the volume mount folder.
Regardless of the approach, a volume needs to be mounted to a container, and the container needs to be started to add files to the volume through the container.
Upvotes: 1
Reputation: 4590
Yes, you can create a volume to be used by an IBM container.
Here is the command to create a new volume:
$ cf ic volume create vol_name
After volume is created you can start your container like this:
$ cf ic run -v vol_name:/usr/local/config --name my_container my_image
You can read complete documentation on volumes in the link below:
https://console.ng.bluemix.net/docs/containers/container_creating_ov.html#container_volumes_ov
Upvotes: 0