Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a go-build Buildpack #93

Closed
kvedurmu opened this issue Jun 19, 2020 · 2 comments
Closed

Create a go-build Buildpack #93

kvedurmu opened this issue Jun 19, 2020 · 2 comments
Assignees

Comments

@kvedurmu
Copy link
Member

kvedurmu commented Jun 19, 2020

Per the Go language family re-architecture RFC we should implement a packit written go-build Buildpack that builds the go binary and writes a start command for the app.

After this change is made, ordering in the Language Family Go Buildpack should look something like

..........................................
[[order]]
  [[order.group]]
    id = "go-dist"
  [[order.group]]
    id = "go-build"
@ryanmoran
Copy link
Member

ryanmoran commented Jun 30, 2020

Tasks:

@kvedurmu
Copy link
Member Author

kvedurmu commented Jul 7, 2020

This looks great! Verified that I can build a simple Go app (that doesn't use dep or go-mod), it detects on go-dist and go-build, has packit style log output, and app is runnable. Closing this.

pack build go-simple-app --buildpack gcr.io/paketo-buildpacks/go --verbose
..................................
Using build cache volume pack-cache-e052a863607d.build
===> DETECTING
======== Output: paketo-buildpacks/go-mod@0.0.134 ========
no "go.mod" found at: /workspace/go.mod
======== Results ========
pass: paketo-buildpacks/go-dist@0.0.178
fail: paketo-buildpacks/go-mod@0.0.134
======== Output: paketo-buildpacks/dep@0.0.146 ========
failed detection: no Gopkg.toml found at root level
======== Results ========
pass: paketo-buildpacks/go-dist@0.0.178
fail: paketo-buildpacks/dep@0.0.146
======== Results ========
pass: paketo-buildpacks/go-dist@0.0.178
pass: paketo-buildpacks/go-build@0.0.5
Resolving plan... (try #1)
paketo-buildpacks/go-dist  0.0.178
paketo-buildpacks/go-build 0.0.5
===> ANALYZING
Previous image with name "index.docker.io/library/go-simple-app:latest" not found
===> RESTORING
===> BUILDING
Go Distribution Buildpack 0.0.178
  Resolving Go version
    Candidate version sources (in priority order):
      <unknown> -> ""

    Selected Go version (using <unknown>): 1.14.4

  Executing build process
    Installing Go 1.14.4
      Completed in 22.814s
Go Build Buildpack 0.0.5
  Executing build process
    Running 'go build -o /layers/paketo-buildpacks_go-build/targets/bin -buildmode pie .'
      Completed in 1m0.976s

  Assigning launch processes
    web: /layers/paketo-buildpacks_go-build/targets/bin/workspace
===> EXPORTING
no project metadata found at path './project-metadata.toml', project metadata will not be exported
Writing tarball for layer "launcher"
Adding layer 'launcher'
Layer 'launcher' SHA: sha256:5b1dacb6040972a1132c886113abdb4e21da3f458b5d9dea09a1adea5ecb09b9
Writing tarball for layer "paketo-buildpacks/go-build:targets"
Adding layer 'paketo-buildpacks/go-build:targets'
Layer 'paketo-buildpacks/go-build:targets' SHA: sha256:eaa63a3ea0253788a165bd8b7755cf7758c1231fda27dfe57c5c95ff20c609b6
Layer 'app' SHA: sha256:79d484e29aeacbd7d4afe00dd8071ff6c4d808ecfa51f78d680b289379a3906d
Adding 1/1 app layer(s)
Writing tarball for layer "config"
Adding layer 'config'
Layer 'config' SHA: sha256:fe90ff81d22409962c8517ad42310dbf00d7518a55a84b91bdcb90b36e2da023
*** Images (51d6b7492987):
      index.docker.io/library/go-simple-app:latest

*** Image ID: 51d6b7492987a37928118dc3f48667f8f285f77162113e900a012fa379bd1ad6
Writing tarball for layer "paketo-buildpacks/go-dist:go"
Adding cache layer 'paketo-buildpacks/go-dist:go'
Layer 'paketo-buildpacks/go-dist:go' SHA: sha256:8124afca5fcf889870498ef75b0d9821a32ea367ac73aeacfcbf3e9c6f77bc2b
Writing tarball for layer "paketo-buildpacks/go-build:gocache"
Adding cache layer 'paketo-buildpacks/go-build:gocache'
Layer 'paketo-buildpacks/go-build:gocache' SHA: sha256:67586da07fcf2913d9f0d229d8e70956353085e85ae8087c9ab49255526da225
Successfully built image go-simple-app

@kvedurmu kvedurmu closed this as completed Jul 7, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants