How to get openshift oc command working on Raspberry pi 3?

こ雲淡風輕ζ 提交于 2019-12-12 04:39:36

问题


I'm trying to compile openshift origin source on my raspberry pi 3 but it keeps timing out.

The tutorial I'm following is from here

Reason I'm doing this is because I get the error

./oc: cannot execute binary file: Exec format error

when I download the file directly from here and use it.

So can anyone tell me what I have to do to make this work or how I fix the errors?

With openshift 2 being discontinued soon, I cannot access my application with rhc anymore (which works fine on my RPi3).


回答1:


The Pi probably does not have enough RAM to compile oc. I suggest running something like the following on your primary machine and copying the resulting binary to the Pi:

CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GOARM=7 go build -v -tags 'include_gcs include_oss containers_image_openpgp' github.com/openshift/origin/cmd/oc



回答2:


Got it working, here's the answer for others and for future reference.

  1. Clone the repo
  2. Switch to tag v.1.5.1
  3. Install go for windows and configure environment variables
    • Had to move the repo to the GOPATH and create some folders in it (src/github.com/openshift/origin)
  4. Open terminal and set some values
    • set CGO_ENABLED=0
    • set GOOS=linux
    • set GOARCH=arm
    • set GOARM=7
  5. Use the command go build -v github.com/openshift/origin/cmd/oc

And you will get an executable that is usable for the RPi 3



来源:https://stackoverflow.com/questions/46391139/how-to-get-openshift-oc-command-working-on-raspberry-pi-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!