3

I want to run docker-compose up on a remote docker daemon:

DOCKER_HOST=tcp://...:2375 docker-compose up

In docker-compose.yml, I have a volume binding to a local file:

version: "3"
services:
  nginx:
    image: nginx:latest
    ports:
      - 80:80
    volumes:
      - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro

This won't work, as the remote docker daemon will be unable to locate ./etc/nginx/nginx.conf.

What is the best approach to handle this?

John Somen
  • 223
  • 1
  • 11

1 Answers1

2

Extend the existing docker image by creating your own docker image. Ref : How to extend existing docker container?

Copy the relevant files (from docker build-context) to appropriate directory and then it will be available in docker image and hence will also be available in remote docker demon as well.

fly2matrix
  • 2,351
  • 12
  • 13