Git Product home page Git Product logo

gopack's Introduction

gopack

Build and publish a Go binary as a minimal OCI image

gopack uses your locally installed version of Go to cross-compile your application, building an OCI image with the resulting binary, and pushing your image to a remote repository or a locally running daemon. Docker not required.

Install

gopack can be installed using the command:

go install github.com/ryanfowler/gopack/cmd/gopack@latest

Go 1.18+ is required.

Usage

Use the gopack run command to build and publish an image. Although all flags are optional, some notable flags are:

  • --base: image to use as the base (default: gcr.io/distroless/static:nonroot)
  • --repository: repository to push the final image to (default: Go binary name)
  • --platform: platform(s) to build the image(s) for (default: linux/amd64)
  • --tag: tag(s) to push the image with (default: latest)
  • --daemon: push the final image to a local daemon, instead of the remote repository (e.g. docker)

Using a custom base image

gopack run ./cmd/gopack -b myimage:tag

Pushing to a specific remote respository

gopack run ./cmd/gopack -r ghcr.io/OWNER/gopack

Building for multiple platforms

gopack run ./cmd/gopack -p linux/amd64 -p linux/arm64

Specifying tags

gopack run ./cmd/gopack -t latest -t 12345678

Push to a local daemon

gopack run ./cmd/gopack --daemon docker

Please run gopack run -h for more information about the available options.

License

Copyright 2023 Ryan Fowler

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

gopack's People

Contributors

dependabot[bot] avatar nesv avatar ryanfowler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gopack's Issues

Push to local registry with port

Hi, how do I push to a local registry with a specific port? Like localhost:5000. If I specify that with the -r flag it returns this error:

Error: push: parsing repository "localhost:5000": repository can only contain the characters `abcdefghijklmnopqrstuvwxyz0123456789_-./`: localhost:5000

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.