Code Monkey home page Code Monkey logo

dockerfile-goxc's Introduction

Dockerfile-gox MIT License

tcnksm/gox Repository | Docker Hub Registry - Repositories of Docker Images

Dockerfile for Cross-compiling golang project with mitchellh/gox.

Description

docker-library/golang (Docker official golang stack) also support image for cross-compile. With Dockerfile-gox, You can cross-compile your golang project parallelly. It's more fast when compiling for multiple platform.

Supported tags

tcnksm/gox image support below tags. Link is its Dockerfile.

Tag is correspond to its golang version.

Usage

If you want to cross-compile with go v1.3.1:

$ docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp tcnksm/gox:1.3.1 

Or if you want to cross-compile with go v1.2:

$ docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp tcnksm/gox:1.2 

You can overwrite command. If you have Makefile with gox:

$ docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp tcnksm/gox:1.3.1 make 

Or if you want to build for 64-bit linux and change output to pkg directory with your favor name:

$ docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp tcnksm/gox:1.3.1 gox -osarch="linux/amd64" -output "pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"

If you want to know gox arguments more, See documents in mitchellh/gox.

light image

light tag provide light image. It only provides linux and darwin, windows build-chain. If you don't need other platform, use this image. You can use it in same way as ordinal one.

Here is image size comparison,

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
tcnksm/gox          1.4.2               98d4147293ca        23 seconds ago      1.787 GB
tcnksm/gox          1.4.2-light         9e30b7109b86        5 minutes ago       533.1 MB

Contribution

  1. Fork (https://github.com/tcnksm/dockerfile-gox/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Push it to your remote repository
  6. Create new Pull Request

Author

tcnksm

dockerfile-goxc's People

Contributors

jrossi avatar tcnksm avatar termie 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.