Can I specify a file instead of a directory to send to the container in the file?

I cannot find the reference documentation to the available fields in I’m trying to import /dev/log from the host into the container so that I can centralize logs to logstash.

From the example, we can see that there is “HostDirectory” and “ContainerDirectory” however I can’t find any analogue for “HostFile”/”ContainerFile”.

  • Docker-compose invalid bind mount spec “/rootfs:ro”: invalid volume specification
  • How to stop gcloud docker -a overwriting long-lived credentials?
  • Docker Alpine nginx 403 Forbidden error for swagger-ui-builder
  • How to debug a non-working passwordless RSA certificate in OpenSSH on Alpine?
  • couldn't run docker when mount volume
  • Add config.txt to docker container
  • How can I specify a single file to be shared with an elastic-beanstalk-enabled docker container?

      "AWSEBDockerrunVersion": "1",
      "Authentication": {
        "Bucket": "my-bucket",
        "Key": "mydockercfg"
      "Image": {
        "Name": "janedoe/image",
        "Update": "true"
      "Ports": [
          "ContainerPort": "1234"
      "Volumes": [
          "HostDirectory": "/var/app/mydb",
          "ContainerDirectory": "/etc/mysql"
      "Logging": "/var/log/nginx"

  • ElasticSearch in docker
  • How to fix ctrl+c inside a docker container
  • Replace default configuration with my own in a Docker image
  • Docker MySQL Host Volume
  • PHP 7 install on Ubuntu 14.04 now fails due to libssl dependency that cant be resolved?
  • How to connect Docker Machine to a remote Docker VirtualBox
  • One Solution collect form web for “Can I specify a file instead of a directory to send to the container in the file?”

    You can mount a host file as a data volume:

    So you should be able to use the "Volumes" section to mount your file to your container.

      "Volumes": [
          "HostDirectory": "/dev/log",
          "ContainerDirectory": "/dev/log"
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.