Docker: Alias command name to run another sibling docker container

I know how to -v the docker socket into a container to make the host’s docker daemon available inside a container. Fine.

I have a dockerized application A that can operate on files on the host.

  • Docker Security issue around ENTRYPOINT
  • docker with device-mapper and luks
  • AWS EC2 Container Service Container Id, what does this mean?
  • How to create a MongoDB docker and save the DB's configuration?
  • How let gogs support ssh
  • Multi Host : Docker Networking
  • I have another dockerized application B that wants to use that application A to operate on files on the host, but is hardcoded to call /usr/bin/A filename.

    How do I alias /usr/bin/A within container B, so that it will call out to the other container, like

    docker run -ti --rm A filename

  • linking kibana with elasticsearch
  • With Docker, which directories are impacted by disk I/O
  • Kubernetes: Unable to create repository
  • Docker compose, webpack permission denied
  • Docker - issue command from one linked container to another
  • How to get RAM, CPU, network usage on a specific process on a container
  • One Solution collect form web for “Docker: Alias command name to run another sibling docker container”

    You could just replace /usr/bin/A in container B with a shell script:

    #!/bin/sh
    docker run -ti --rm A "$@"
    

    You could do this in the image itself (via your Dockerfile), or you could bin-mount the script when you start container B (docker run -v /path/to/my/script:/usr/bin/A ...).

    Now you run /usr/bin/A some_filename and it should do the right thing, assuming that you can successfully run docker inside the container.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.