Can't run test alias under docker
- Dominant language
- Clojure
- Stars
- 558
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
My goal is to run the test alias as part of a CI/CD routine in Google Cloud Build. My approach is to create a new target in the supplied Dockerfile called test:
```
FROM clojure:openjdk-17 AS test
WORKDIR /
COPY . /
RUN clj -P -M:test
ENTRYPOINT exec clj -M:test
```
When I run this image, it just sits there - no output:
```
$ docker build --target test -t test .
[+] Building 35.8s (8/8) FINISHED
....
$ docker run --rm test
```
While debugging, I removed `env/dev/resources/logback.xml` and comparing the output with my non-containerized version. I was able to see where the non-containerized version was enumerating source directories. This lead me to `user.clj` where [`watch-deps`](https://github.com/kit-clj/kit/blob/0dbe5e5ead600d6fa0db04e9e2dc4462fba758b2/libs/deps-template/resources/io/github/kit_clj/kit/env/dev/clj/user.clj#L17) is setup. When I comment this line out, the test alias will runs in the container.
I'm assuming whatever mechanism `watch-deps` is using to monitor filesystem changes is failing in Docker's overlayfs? Also, it appears this isn't an issue is not present if I mount the project source as a volume.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the test target in the supplied Dockerfile and the watch-deps setup in libs/deps-template/resources/io/github/kit_clj/kit/env/dev/clj/user.clj at line 17. Run the reported docker build and docker run commands, then compare behavior with and without watch-deps and with a mounted project volume. Done means the test alias runs in the container without hanging while retaining the expected non-containerized behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, docker
- Domain
- devops, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100