davidkarlsen / bruno-image

5 stars 1 forks source link

How to use? #3

Closed UlrichEckhardt closed 8 months ago

UlrichEckhardt commented 8 months ago

Hi David,

great initiative, thanks for making this start with Bruno in Docker packaging!

Anyhow, I checked this out and was wondering how you are using the built image. I would normally mount a collection of tests as a volume into the container, but using the root directory (which is the WORKDIR) doesn't work. Are you using this as a base-image only or how do you use this?

I've forked the repo and set the WORKDIR to /bruno, which then allows running it with docker run --rm --volume .:/bruno .... I also added a README and a bit of boilerplate. If you want to take a look, it's under https://github.com/UlrichEckhardt/bruno-image. It's not ready for a PR yet though and I first wanted to ask you about it anyway.

Have a great weekend!

Uli

davidkarlsen commented 8 months ago

we run it like this, using docker-compose:

services:
  bruno:
    platform: linux/amd64
    image: ghcr.io/davidkarlsen/bruno-image:main
    pull_policy: always
    network_mode: host
    working_dir: /tests
    volumes:
    - ./refapp-domain-api/src/test/resources/bruno-api-smoketest:/tests
    environment:
      - BASE_URL
      - API_KEY
davidkarlsen commented 8 months ago

Your changes look good - a PR would be great. Have a nice weekend!

UlrichEckhardt commented 8 months ago

Oh, nice. To some extend, that way is the same as using WORKDIR in the Dockerfile, but I actually prefer yours. With my approach, you need to know the "magic" /bruno location which is set in the Dockerfile, with your way there is a clear connection between the working dir and the mount target.

I'll adjust things and create a PR tomorrow!

Uli