Can I populate the content of the Volume I created in Bluemix Containers?

I uploaded a Oracle11g DB image in my Bluemix Container registry.
I created a volume called oradbdata in IBM Containers using the CLI:

cf ic volume create oradbdata

Now I need to copy some content into this volume before running the container.

  • How to specify IBM Containers' IP to register
  • What's wrong with this dockerfile
  • kubectl: Connection to server was refused
  • How can you write a docker daemon that can kick off other docker containers as needed?
  • Deploying to dockerized Jboss Zip Exception
  • Enable CORS on Cloudant local
  • Is there anyway to access this volume and populate its content?

    Lionel

  • Starting oracle with docker: “TNS:listener: all appropriate instances are blocking new connections” error
  • how to use --since option with docker logs command
  • Creating a docker Base Image
  • Configure docker daemon logs
  • Docker configuration using the systemd configuration style
  • Can I bundle the Oracle JDBC driver JAR in a Docker image?
  • 2 Solutions collect form web for “Can I populate the content of the Volume I created in Bluemix Containers?”

    When you start the container you can associate the volume to the desired container path; for example: volume oradbdata -> /var/lib/oradata. When the container then starts the /var/lib/oradata is mapped with your volume and, at that point, you can put data on it either at the start-up of the container or accessing the container via ssh.

    I suggest adding your files into the container during the container build (e.g. into a /src directory). Then use a startup script for your app. In the script you would check if the mounted directory has the file(s) you need. If not then copy things over. Something like this:

    #!/bin/bash
    
    # Test if the volume is empty
    if [ ! -f /mountpoint/testfile ]; then
    
        # Copy the contents from the container image into the volume
        cp -R /src/* /mountpoint
    
    fi
    
    # Now start the app here
    /usr/bin/myapp
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.