Giter VIP home page Giter VIP logo

go-binary_and_dockerimage-aarch64_armv7l_x86's Introduction

go binary packages for AARCH64, ARMv7l and X86 and Docker Image for creating the packages

This repository provides go (golang) binary packages for

  • AARCH64 (aarch64/arm64v8/arm64)
  • ARMv7l (armv7l/arm32v7/armhf)
  • X86 (i386/i686/ia32/x86)

as well as the Docker Image used for building the binary packages.

Using the pre-built binary

Extract the binary package from ./binary/go<VERSION>.linux-<ARCH>.tar.7z.* to /usr/local/ on the AARCH64 or ARMv7l or X86 machine.

If you don't already have 7-Zip then install it first:

$ sudo apt-get install p7zip

Now extract the binary package:

$ 7zr x -so "binary/go<VERSION>.linux-<ARCH>.tar.7z.001" | sudo tar xf - -C /usr/local/
$ sudo ln -s /usr/local/go/bin/go /usr/local/bin/
$ sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/

Verify that the binary is OK:

$ export GOROOT=/usr/local/go
$ go version

Building the binary

Cross-compiling on a X64/AMD64 host

On the X64/AMD64 host, run:

$ cd cross-build
For AARCH64:
	$ ./build_binary.sh arm64
For ARMv7l:
	$ ./build_binary.sh armhf
For X86:
	$ ./build_binary.sh i386

This will generate the binary package go<VERSION>.linux-<ARCH>.tar.7z.* in ./cross-build/dist/.

Follow above instructions for using the pre-built binary.
You'll just need to replace the path binary/ with dist/.

Compiling a go application

On the AARCH64 or ARMv7l or X86 machine that you've installed go on run the following commands:

$ cd $HOME
$ mkdir -p mygoapp/{src,bin,pkg}
$ export GOROOT=/usr/local/go
$ export GOPATH=$HOME/mygoapp
$ export PATH=$PATH:$GOROOT/bin

Now you're ready to compile your go application under ~/mygoapp/.


The Docker Image is based on:

go-binary_and_dockerimage-aarch64_armv7l_x86's People

Contributors

tsitle avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.