Skip to content

Commit

Permalink
feat: build multiplatform images
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyoucao577 authored Oct 4, 2024
1 parent 01bcc2e commit ca75829
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build Docker

on:
push:
branches: [ "main" ]
branches:
- '**'
tags:
- '**'
paths-ignore:
Expand All @@ -19,12 +20,15 @@ jobs:
- id: pre-step
shell: bash
run: echo "image-tag=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build & Publish Docker Image
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
platforms: linux/amd64,linux/arm64
tags: "${{ github.ref == 'refs/heads/main' && 'latest,' || '' }}${{ steps.pre-step.outputs.image-tag }}"
no_push: ${{ github.event_name == 'pull_request' }}
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommend
RUN pip3 install debugpy

# install golang
RUN wget --no-check-certificate --progress=dot:mega https://go.dev/dl/go1.22.3.linux-amd64.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xvf go1.22.3.linux-amd64.tar.gz && \
rm go1.22.3.linux-amd64.tar.gz
RUN export ARCH=$(dpkg --print-architecture) && curl -OL https://go.dev/dl/go1.22.3.linux-${ARCH}.tar.gz && \
rm -rf /usr/local/go && tar -C /usr/local -xvf go1.22.3.linux-${ARCH}.tar.gz && rm go1.22.3.linux-${ARCH}.tar.gz

# install tman
RUN wget --no-check-certificate --progress=dot:mega https://github.com/TEN-framework/ten_framework/releases/download/0.3.0-alpha/tman-linux-x64-clang-release.zip && \
unzip tman-linux-x64-clang-release.zip && \
RUN export ARCH=$(dpkg --print-architecture) && \
if [ ${ARCH} = "amd64" ]; then export ARCH="x64" ; fi && \
wget --no-check-certificate --progress=dot:mega https://github.com/TEN-framework/ten_framework/releases/download/0.3.0-alpha/tman-linux-${ARCH}-clang-release.zip && \
unzip tman-linux-${ARCH}-clang-release.zip && \
mv ten_manager/bin/tman /usr/local/bin/ && \
rm -rf tman-*.zip ten_manager

# install ten_gn
RUN git clone https://github.com/TEN-framework/ten_gn.git /usr/local/ten_gn && \
cd /usr/local/ten_gn && \
git checkout d6018ddf9b7d7c851bb416a2e77f24fc9719dc4c
git checkout 9bbd871c3a645b63a00e21fcb2bedb69848e703e

ENV PATH=/usr/local/go/bin:/usr/local/ten_gn:$PATH

0 comments on commit ca75829

Please sign in to comment.