compose-switch
compose-switch copied to clipboard
Add Support for `arm7l` architecture
Wanted to move to use compose-switch on my raspberrypi, but it seems that there's no compose-switch for armv7 :(
$ uname -m
armv7l
Yes please.
For he time being I am using docker context use <armv7l-machine>
from a different machine which supports docker-compose
.
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
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
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
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
Strangely enough -- running on armv7l
- getting exec format error
when running the package from go with GOOS=linux -e GOARCH=arm golang:1.18