Skip to content

specify docker files inline (ie Inline dockerfile:) #8077

@lonewarrior556

Description

@lonewarrior556

RIght now I have this

services:
  app1:
    build:
      context: ../server
      dockerfile: $PWD/a-app1.Dockerfile

  app2:
    build:
      context: ../app
      dockerfile: $PWD/b-app2.Dockerfile

  app3:
    build:
      context: ../cypress
      dockerfile: $PWD/c-app2.Dockerfile

This requires me to have 3 docker files and jump around to view what's building, even though some of these are really simple.
I would love to be able to have all the info in my docker-compose.yml file

services:
  app1:
    build:
      context: ../server
      dockerfile: |
        FROM nginx:alpine
        COPY nginx.conf /etc/nginx/nginx.conf

  app2:
    build:
      context: ../app
      dockerfile: | 
        FROM nodeJS
        COPY . .
        CMD ['npm', 'start']

  app3:
    build:
      context: ../cypress
      dockerfile: | 
        FROM cypress
        COPY . .

I don't see how it's possible to currently do this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions