Skip to content
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

Docker image for arm64 #1262

Closed
odidev opened this issue Jul 23, 2020 · 16 comments
Closed

Docker image for arm64 #1262

odidev opened this issue Jul 23, 2020 · 16 comments
Assignees
Labels
area: docker enhancement New feature or improvement

Comments

@odidev
Copy link
Contributor

odidev commented Jul 23, 2020

Is your feature request related to a problem? Please describe.
Hi Team,

Are you planning to release golangci/golangci-lint image for arm64?

Describe the solution you'd like
I am checking on adding arm64 support in Travis-CI for kube-router package, but I was facing issue in pulling golangci-lint image for arm64 as it is not available in the docker hub. I have observed that golangci-lint has support for arm64 platform. I was successful in building golangci-lint docker image in my local arm64 machine. May I know, Is it possible to make the image also available for arm64?

@odidev odidev added the enhancement New feature or improvement label Jul 23, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 23, 2020

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@sayboras
Copy link
Member

@odidev I can't think of any reason stopping us from doing this. Are you planning to contribute and send the PR for this ?

@odidev
Copy link
Contributor Author

odidev commented Jul 23, 2020

Thanks for the reply. I didn't update anything in the Dockerfile, it was perfectly building docker image when ran in my arm64 local machine. I was just thinking that if you could release image for arm64 in dockerhub. May I know, how can I contribute in doing that?

@sayboras
Copy link
Member

can you share the steps that you performed ? I can test it out with my raspi :)

@odidev
Copy link
Contributor Author

odidev commented Jul 27, 2020

I didn't update anything in the Dockerfile. The Steps followed to build the docker image for arm64 are -

  1. Install pre-built binary of golangci/golangci-lint using command
    wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.29.0
  2. docker build -t <Image-name>:<tag> -f <path to Dockerfile> .

For building image using Dockerfile.alpine
docker build -t <Image-name>:<tag> -f <path to Dockerfile.alpine> .

I am happy to help if any more information is required.

@SVilgelm
Copy link
Member

The golancgci-lint uses goreleaser tool to build all binaries and docker files. Unfortunately the goreleaser does not support multi-arch builds right now: goreleaser/goreleaser#530

@SVilgelm
Copy link
Member

you can always download an arm version of binary from the latest release

@odidev
Copy link
Contributor Author

odidev commented Aug 10, 2020

As we don't have multi-arch support in goreleaser, I have added docker release code in tag.yml to release images through github-actions and images got uploaded for both amd64 and arm64 in docker hub successfully. Please check the below links for more details.

Commit Link- odidev@cf45b63

Github actions Link- https://github.com/odidev/golangci-lint/runs/965764172?check_suite_focus=true

Dockerhub Link- https://hub.docker.com/repository/docker/odidev/golangci-lint/tags?page=1

Please check and let me know if I can raise PR with these changes.

@SVilgelm
Copy link
Member

it will be great if we can modify goreleaser, so all depended project can re-use this feature

@odidev
Copy link
Contributor Author

odidev commented Aug 12, 2020

Since go-release does not support multi-arch so I have tried supporting it through another way
We can release through changes done by me as well. Please check and let me know if we can proceed with these changes

@odidev
Copy link
Contributor Author

odidev commented Sep 16, 2020

Can anyone please review my changes and let me know if we can proceed with these changes.

Link - odidev@cf45b63

@sayboras
Copy link
Member

sayboras commented Sep 16, 2020

@odidev can we use https://github.com/docker/build-push-action instead for building multi-arch docker intead ? Dancing around the script is fine, but make it hard to mantain though.

Additionally, if we want to do this, we need to remove docker step in goreleaser, and build multi-arch docker image using buildx, however, release note will not have docker details.

PS: As you are already working on this, I just assign this to you 👍

@odidev
Copy link
Contributor Author

odidev commented Sep 17, 2020

@sayboras I have done the changes as per your suggestions. Can you please review the changes and suggest if any change is required?

Commit Link - odidev@6b002d5

Dockerhub Link - https://hub.docker.com/repository/registry-1.docker.io/odidev/golangci-lint/tags?page=1

@sayboras
Copy link
Member

Can you replace RUN git clone https://github.com/prakriti07/golangci-lint by multi-stage docker build ? You can send draft PR for early feedback as well.

@odidev
Copy link
Contributor Author

odidev commented Sep 21, 2020

@sayboras I have raised the draft PR as per your suggestion. Can you please review it?

PR Link - #1383

@sayboras
Copy link
Member

Fixed as part of #1383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docker enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

4 participants