Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: build and publish multiarch image#46

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 1 commit intomainfrommatifali/arm64
Jul 30, 2024
Merged

Conversation

matifali
Copy link
Member

@matifalimatifali commentedJul 16, 2024
edited
Loading

This pull request updates the release workflow to build and push a multi-arch image and simplifies the CI process. The changes include:

Supersedes#44
Closes#29

flipperdolphin reacted with thumbs up emoji
Comment on lines -33 to -45
- name: Echo Go Cache Paths
id: go-cache-paths
run: |
echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT

- name: Go Build Cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.GOCACHE }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}

# Install Go!
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

setup-go has a built-in cache that works as expected.

Comment on lines -24 to -36
-name:Echo Go Cache Paths
id:go-cache-paths
run:|
echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
-name:Go Build Cache
uses:actions/cache@v3
with:
path:${{ steps.go-cache-paths.outputs.GOCACHE }}
key:${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}

-uses:actions/setup-go@v5
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

setup-go has a built-in cache that works as expected.

Comment on lines -54 to -62
-name:Push Image
run:|
VERSION=$(./scripts/version.sh)
BASE=ghcr.io/coder/coder-logstream-kube
IMAGE=$BASE:$VERSION
docker tag coder-logstream-kube:latest $IMAGE
docker tag coder-logstream-kube:latest $BASE:latest
docker push $IMAGE
docker push $BASE:latest
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

moved pushing and building to the./scripts/build.sh

johnstcn reacted with thumbs up emoji
Comment on lines 37 to 45
# Build
if [ "$CI" = "false" ]; then
docker buildx build --platform linux/$current -t coder-logstream-kube --load .
else
VERSION=$(../scripts/version.sh)
BASE=ghcr.io/coder/coder-logstream-kube
IMAGE=$BASE:$VERSION
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t $IMAGE -t $BASE:latest --push.
fi
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

--load only works for single arch images, so it can not be used with a multi arch manifest. As a workaround, I split the local and CI build commands.

Locally, we only build for the current arch; in CI, we create a multi-arch image.

@matifalimatifali changed the titleAdd multiarch image and simplify CIfeat: build and publish multiarch imageJul 16, 2024
@matifalimatifali requested review fromjohnstcn and removed request forcoadler anddeansheatherJuly 26, 2024 09:49
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could do with a run ofshellcheck onbuild.sh but I don't need to review again.

matifali reacted with thumbs up emoji

ENTRYPOINT ["/coder-logstream-kube"]
FROM --platform=$BUILDPLATFORM scratch AS base
ARG TARGETARCH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

matifali reacted with thumbs up emoji
@matifalimatifali merged commit89b4709 intomainJul 30, 2024
1 check passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

@matifalimatifali

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Build executable for ARM64
2 participants
@matifali@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp