All Projects → thockin → Go Build Template

thockin / Go Build Template

Licence: apache-2.0
A Makefile/Dockerfile example for Go projects.

Programming Languages

Makefile
30231 projects
go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Go Build Template

Learning Cmake
learning cmake
Stars: ✭ 2,524 (-3.85%)
Mutual labels:  makefile
Migrating To Cloud Native Application Architectures
《迁移到云原生应用架构》中文版 https://jimmysong.io/migrating-to-cloud-native-application-architectures/
Stars: ✭ 203 (-92.27%)
Mutual labels:  makefile
Provision docker
Test Ansible roles and playbooks using Docker
Stars: ✭ 207 (-92.11%)
Mutual labels:  makefile
Cheat Sheets
Cheat sheets for various stuff
Stars: ✭ 201 (-92.34%)
Mutual labels:  makefile
Learn You A Haskell
“Learn You a Haskell for Great Good!” by Miran Lipovača
Stars: ✭ 202 (-92.3%)
Mutual labels:  makefile
Docker Makefile
Makefile for building docker repository releases
Stars: ✭ 204 (-92.23%)
Mutual labels:  makefile
Getting Started With Knative
Knative入门——构建基于 Kubernetes 的现代化Serverless应用 - https://www.servicemesher.com/getting-started-with-knative/
Stars: ✭ 197 (-92.5%)
Mutual labels:  makefile
React Barcode
A <Barcode/> component for use with React.
Stars: ✭ 210 (-92%)
Mutual labels:  makefile
Git osx installer
Installer for OS X
Stars: ✭ 202 (-92.3%)
Mutual labels:  makefile
Helmfiles
Comprehensive Distribution of Helmfiles for Kubernetes
Stars: ✭ 205 (-92.19%)
Mutual labels:  makefile
Mytermuxdoc
中文Termux文档
Stars: ✭ 201 (-92.34%)
Mutual labels:  makefile
Device brcm rpi2
Stars: ✭ 201 (-92.34%)
Mutual labels:  makefile
Openwrt Pcap dnsproxy
Pcap_DNSProxy for OpenWrt/LEDE
Stars: ✭ 204 (-92.23%)
Mutual labels:  makefile
Nodejs Rpm
node.js rpm spec
Stars: ✭ 199 (-92.42%)
Mutual labels:  makefile
Pcat open source
PointCloud Annotation Tools, support to label object bound box, ground, lane and kerb
Stars: ✭ 209 (-92.04%)
Mutual labels:  makefile
Playing Cards Assets
Playing Cards Image Assets (SVG+PNG)
Stars: ✭ 197 (-92.5%)
Mutual labels:  makefile
Alpinewsl
Alpine Linux based WSL distribution. Supports multi-install. Lightest WSL distribution.
Stars: ✭ 203 (-92.27%)
Mutual labels:  makefile
Easyrtspclient
Streaming media sdk tool:An elegant, simple, high performance & high compatibility RTSP Client Utility,can use in RTSP Player,NVR,RTSP Relay,EasyRTSPClient can run in any platform ,such as x68/x64/Windows/Linux/Android/iOS/arm etc..,with flexible interface,EasyRTSPClient can fit almost all network IPCamera,very easy to use.简单、稳定、高效、易用的RTSPClient工具,支持Windows、Linux、ARM、Android、iOS等几乎所有平台,支持RTP Over TCP/UDP,支持断线重连,能够接入市面上99%以上的IPC,调用简单且成熟稳定!
Stars: ✭ 213 (-91.89%)
Mutual labels:  makefile
Browserpass Native
Browserpass native client app
Stars: ✭ 209 (-92.04%)
Mutual labels:  makefile
Docs
Documentation for setting up OpenAPS
Stars: ✭ 204 (-92.23%)
Mutual labels:  makefile

Go app template build environment

Build Status

This is a skeleton project for a Go application, which captures the best build techniques I have learned to date. It uses a Makefile to drive the build (the universal API to software projects) and a Dockerfile to build a docker image.

This has only been tested on Linux, and depends on Docker to build.

Customizing it

To use this, simply copy these files and make the following changes:

Makefile:

  • change BINS to your binary name(s)
  • replace cmd/myapp-* with one directory for each of your BINS
  • change REGISTRY to the Docker registry you want to use
  • maybe change SRC_DIRS if you use some other layout
  • choose a strategy for VERSION values - git tags or manual

Dockerfile.in:

  • maybe change or remove the USER if you need

Go Modules

This assumes the use of go modules (which will be the default for all Go builds as of Go 1.13) and vendoring (which reasonable minds might disagree about). You will need to run go mod vendor to create a vendor directory when you have dependencies.

Building

Run make or make build to compile your app. This will use a Docker image to build your app, with the current directory volume-mounted into place. This will store incremental state for the fastest possible build. Run make all-build to build for all architectures.

Run make container to build the container image. It will calculate the image tag based on the most recent git tag, and whether the repo is "dirty" since that tag (see make version). Run make all-container to build containers for all supported architectures.

Run make push to push the container image to REGISTRY. Run make all-push to push the container images for all architectures.

Run make clean to clean up.

Run make help to get a list of available targets.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].