Skip to content

Commit

Permalink
don't build in container to avoid cross build on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe committed Oct 29, 2024
1 parent 850b4da commit 22d8c54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:

container-image:
runs-on: ubuntu-24.04
needs:
- build
env:
IMAGE_NAME: gardenlinux/glvd-api
IMAGE_TAG: latest
Expand All @@ -61,6 +63,13 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- run: mkdir -p build
- name: Download built jar
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build

- name: Install qemu dependency for multi-arch build
run: |
sudo apt-get update
Expand Down
8 changes: 4 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ RUN apt-get update -q && apt-get install -y binutils
RUN mkdir /usr/src/glvd
COPY . /usr/src/glvd
WORKDIR /usr/src/glvd
RUN ./gradlew --no-daemon build -x asciidoctor -x test
RUN jar xf build/libs/glvd-0.0.1-SNAPSHOT.jar
COPY build/libs/glvd-0.0.1-SNAPSHOT.jar glvd.jar
RUN jar xf glvd-0.0.1-SNAPSHOT.jar
RUN jdeps --ignore-missing-deps -q \
--recursive \
--multi-release 21 \
--print-module-deps \
--class-path 'BOOT-INF/lib/*' \
build/libs/glvd-0.0.1-SNAPSHOT.jar > deps.info
glvd-0.0.1-SNAPSHOT.jar > deps.info
RUN jlink \
--add-modules $(cat deps.info) \
--strip-debug \
Expand All @@ -26,6 +26,6 @@ ENV JAVA_HOME /user/java/jdk17
ENV PATH $JAVA_HOME/bin:$PATH
COPY --from=build /tinysapmachine $JAVA_HOME
RUN mkdir /glvd
COPY --from=build /usr/src/glvd/build/libs/glvd-0.0.1-SNAPSHOT.jar /glvd/
COPY --from=build /usr/src/glvd/glvd-0.0.1-SNAPSHOT.jar /glvd/
WORKDIR /glvd
ENTRYPOINT java -jar glvd-0.0.1-SNAPSHOT.jar

0 comments on commit 22d8c54

Please sign in to comment.