-
Notifications
You must be signed in to change notification settings - Fork 17
feat(auth):Build and push Container image multi arch using github workflow[#116] #130
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
Merged
youngtaekiim
merged 5 commits into
eclipse-pullpiri:refactoring
from
akshaylg0314:refactoring
Jul 17, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
64ce119
feat(auth):Build and push Container image multi arch using github worβ¦
akshayg0314 7cc223e
Merge pull request #5 from akshaylg0314/CD_PIPELINE
akshayg0314 7c3ac96
feat(auth):Changes for address review comments[#116]
akshayg0314 1f99e1f
Merge branch 'refactoring' into CD_PIPELINE
akshayg0314 65aee0c
Merge pull request #6 from akshaylg0314/CD_PIPELINE
akshayg0314 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Build and Push Container Images | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| packages: write | ||
|
|
||
| env: | ||
| ContainerRegistry: "ghcr.io" | ||
| IMAGE_NAME: ${{ github.repository }} | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # -------- Build and Push: Server -------- | ||
| - name: Build and push Server multi-arch image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: containers/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| build-args: | | ||
| COMPONENT=server | ||
| TARGETARCH | ||
| tags: ${{ env.ContainerRegistry }}/${{ env.IMAGE_NAME }}-server:${{ github.ref_name }} | ||
|
|
||
| # -------- Build and Push: Agent -------- | ||
| - name: Build and push Agent multi-arch image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: containers/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| build-args: | | ||
| COMPONENT=agent | ||
| TARGETARCH | ||
| tags: ${{ env.ContainerRegistry }}/${{ env.IMAGE_NAME }}-agent:${{ github.ref_name }} | ||
|
|
||
| # -------- Build and Push: Player -------- | ||
| - name: Build and push Player multi-arch image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: containers/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| build-args: | | ||
| COMPONENT=player | ||
| TARGETARCH | ||
| tags: ${{ env.ContainerRegistry }}/${{ env.IMAGE_NAME }}-player:${{ github.ref_name }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # SPDX-FileCopyrightText: Copyright 2024 LG Electronics Inc. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| ############################ | ||
| # === Build Stage === | ||
| ############################ | ||
| FROM rust:1.85.0-slim AS builder | ||
|
|
||
| ARG COMPONENT | ||
| ARG TARGETARCH | ||
|
|
||
| ENV COMPONENT=${COMPONENT} | ||
| ENV TARGETARCH=${TARGETARCH} | ||
|
|
||
| WORKDIR /pullpiri | ||
|
|
||
| # Copy shared and component-specific source code into container | ||
| COPY ./src/common /pullpiri/common | ||
| COPY ./src/${COMPONENT} /pullpiri/${COMPONENT} | ||
|
|
||
| # Install necessary libraries and build component | ||
| RUN apt update -y && \ | ||
| apt install -y \ | ||
| libdbus-1-dev \ | ||
| pkg-config \ | ||
| protobuf-compiler \ | ||
| libssl-dev && \ | ||
| cd /pullpiri/${COMPONENT} && \ | ||
| cargo build --release | ||
|
|
||
| # Prepare glibc shared libraries for static alpine runtime | ||
| WORKDIR /dummy | ||
| RUN if [ "$TARGETARCH" = "amd64" ]; then \ | ||
| ITEMARCH="x86_64"; \ | ||
| mkdir -p /dummy/lib64 /dummy/${ITEMARCH}-linux-gnu/ && \ | ||
| cp -v /lib64/ld-linux-x86-64.so.2 /dummy/lib64/ || true && \ | ||
| cp -v /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /dummy/${ITEMARCH}-linux-gnu/ || true; \ | ||
| elif [ "$TARGETARCH" = "arm64" ]; then \ | ||
| ITEMARCH="aarch64"; \ | ||
| mkdir -p /dummy/${ITEMARCH}-linux-gnu/ && \ | ||
| cp -v /lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 /dummy/${ITEMARCH}-linux-gnu/ || true && \ | ||
| cp -v /lib/ld-linux-aarch64.so.1 /dummy/ || true; \ | ||
| else \ | ||
| echo "Unsupported architecture: $TARGETARCH" && exit 1; \ | ||
| fi && \ | ||
| for lib in \ | ||
| libc.so.6 libcap.so.2 libdbus-1.so.3 libgcc_s.so.1 \ | ||
| libgcrypt.so.20 libgpg-error.so.0 liblzma.so.5 \ | ||
| liblz4.so.1 libm.so.6 libsystemd.so.0 libzstd.so.1; do \ | ||
| cp -v /lib/${ITEMARCH}-linux-gnu/$lib* /dummy/${ITEMARCH}-linux-gnu/ || true; \ | ||
| done | ||
|
|
||
| ############################ | ||
| # === Runtime Stage === | ||
| ############################ | ||
| FROM alpine:3.21.3 | ||
|
|
||
| ARG COMPONENT | ||
| ARG TARGETARCH | ||
|
|
||
| ENV COMPONENT=${COMPONENT} | ||
| ENV TARGETARCH=${TARGETARCH} | ||
|
|
||
| WORKDIR /pullpiri | ||
|
|
||
| # Copy runtime shared libraries | ||
| COPY --from=builder /dummy /lib | ||
|
|
||
| # Ensure dynamic linker is in correct place for glibc-based binaries | ||
| RUN if [ "$TARGETARCH" = "amd64" ]; then \ | ||
| mkdir -p /lib64 && \ | ||
| cp -v /lib/lib64/ld-linux-x86-64.so.2 /lib64/ || true; \ | ||
| elif [ "$TARGETARCH" = "arm64" ]; then \ | ||
| echo "Using aarch64 runtime"; \ | ||
| else \ | ||
| echo "Unsupported architecture: $TARGETARCH" && exit 1; \ | ||
| fi | ||
|
|
||
| # Copy built Rust binary | ||
| COPY --from=builder /pullpiri/${COMPONENT}/target/release/ /pullpiri/ | ||
|
|
||
| # Copy shared runtime config | ||
| COPY ./src/settings.yaml . | ||
|
|
||
| # Entry point | ||
| CMD ["sh"] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.