Skip to content

Infra: Add local DiD build option #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .dev/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:latest

RUN apt update && apt -y install \
maven \
openjdk-17-jdk

RUN curl https://get.docker.com/ | bash -
RUN curl https://get.pnpm.io/install.sh | bash -

COPY . /build

COPY .dev/builder/docker-entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

WORKDIR /build

ENTRYPOINT ["entrypoint.sh"]

CMD mvn -DskipTests=true -Pprod clean package
10 changes: 10 additions & 0 deletions .dev/builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Run:
```
docker-compose up --renew-anon-volumes --build && docker-compose down
```

-----
To debug run before:
```
#export BUILDKIT_PROGRESS=plain docker compose build
```
21 changes: 21 additions & 0 deletions .dev/builder/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.8'
name: "kafbat_builder"

services:

chonky-builder:
container_name: chonky-builder
build:
context: ../..
dockerfile: .dev/builder/Dockerfile
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ../..:/build
- node_modules:/build/frontend/node_modules/ # Do not alter this as node_modules might not be transferable between OS w/ different arch
- ${HOME}/.m2/repository:/root/.m2/repository # but it's not the case for maven (which also takes ten times longer to dl)
environment:
- DOCKER_HOST=unix:///var/run/docker.sock
# command: mvn -DskipTests=true -Pprod clean package # this is the default command, feel free to override if needed

volumes:
node_modules:
6 changes: 6 additions & 0 deletions .dev/builder/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# The volume is mounted from the host but the contents are intact, need to clean
find /build/frontend/node_modules -mindepth 1 -delete

exec "$@"
Loading