compose-switch icon indicating copy to clipboard operation
compose-switch copied to clipboard

Add Support for `arm7l` architecture

Open guyk-yahoo opened this issue 3 years ago • 6 comments

Wanted to move to use compose-switch on my raspberrypi, but it seems that there's no compose-switch for armv7 :(

$ uname -m
armv7l

guyk-yahoo avatar Nov 22 '21 12:11 guyk-yahoo

Yes please.

For he time being I am using docker context use <armv7l-machine> from a different machine which supports docker-compose.

tilusnet avatar Dec 30 '21 18:12 tilusnet

Since cross compilation in Go works well, I built an ARM binary on my desktop using Docker and then copied it over (following the manual instructions other than the download step):

docker run --name compose-switch-builder -e GOOS=linux -e GOARCH=arm golang:1.18 go install github.com/docker/[email protected] \
&& docker cp compose-switch-builder:/go/bin/linux_arm/compose-switch ./compose-switch \
&& docker rm -f compose-switch-builder

Alternatively, if you have Go installed on your Raspberry Pi, you can build it locally:

go install github.com/docker/[email protected]
sudo mv "$(go env GOPATH)/bin/compose-switch" /usr/local/bin/compose-switch

milas avatar Mar 17 '22 12:03 milas

Since cross compilation in Go works well, I built an ARM binary on my desktop using Docker and then copied it over (following the manual instructions other than the download step):

docker run --name compose-switch-builder -e GOOS=linux -e GOARCH=arm golang:1.18 go install github.com/docker/[email protected] \
&& docker cp compose-switch-builder:/go/bin/linux_arm/compose-switch ./compose-switch \
&& docker rm -f compose-switch-builder

Alternatively, if you have Go installed on your Raspberry Pi, you can build it locally:

go install github.com/docker/[email protected]
sudo mv "$(go env GOPATH)/bin/compose-switch" /usr/local/bin/compose-switch

If so. Would it be too hard to create a GitHub release compiled for Arm7l? This must be merely a github workflow configuration

GuyKh avatar Mar 18 '22 07:03 GuyKh

Since cross compilation in Go works well, I built an ARM binary on my desktop using Docker and then copied it over (following the manual instructions other than the download step):

docker run --name compose-switch-builder -e GOOS=linux -e GOARCH=arm golang:1.18 go install github.com/docker/[email protected] \
&& docker cp compose-switch-builder:/go/bin/linux_arm/compose-switch ./compose-switch \
&& docker rm -f compose-switch-builder

Alternatively, if you have Go installed on your Raspberry Pi, you can build it locally:

go install github.com/docker/[email protected]
sudo mv "$(go env GOPATH)/bin/compose-switch" /usr/local/bin/compose-switch

A little fix -- the docker cp should be from /go/bin/compose-switch. The full correct command should be:

docker run --name compose-switch-builder -e GOOS=linux -e GOARCH=arm golang:1.18 go install github.com/docker/[email protected] \
&& docker cp compose-switch-builder:/go/bin/compose-switch ./compose-switch \
&& docker rm -f compose-switch-builder

GuyKh avatar Mar 20 '22 11:03 GuyKh

A little fix -- the docker cp should be from /go/bin/compose-switch. The full correct command should be:

For me running in the above command, I needed the path to be /go/bin/linux_arm/compose-switch as originally stated, otherwise I got an error that the path did not exist while doing the docker cp

Cinderhaze avatar Dec 01 '22 06:12 Cinderhaze

Strangely enough -- running on armv7l - getting exec format error when running the package from go with GOOS=linux -e GOARCH=arm golang:1.18

GuyKh avatar Jan 08 '23 10:01 GuyKh