Giter Club home page Giter Club logo

golang-container's People

Contributors

abduelhamit avatar alexsaezm avatar danielhelfand avatar hhorak avatar jcajka avatar phracek avatar sspeiche avatar vrutkovs avatar yselkowitz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golang-container's Issues

container does not start properly in OpenShift

Using imagestream from PR #4:

>>> oc create -f golang-centos7-image-streams.json

>>> oc new-app golang~http://github.com/cpuguy83/go-md2man
--> Found image 8547624 (7 days old) in image stream "myproject/golang" under tag "1.8" for "golang"

    Go 1.8
    ------
    Go 1.8 available as docker container is a base platform for building and running various Go 1.8 applications and frameworks. Go is an easy to learn, powerful, statically typed language in the C/C++ tradition with garbage collection, concurrent programming support, and memory safety features.

    Tags: builder, golang, golang18, rh-golang18, go

    * A source build using source code from http://github.com/cpuguy83/go-md2man will be created
      * The resulting image will be pushed to image stream "go-md2man:latest"
      * Use 'start-build' to trigger a new build
    * This image will be deployed in deployment config "go-md2man"
    * The image does not expose any ports - if you want to load balance or send traffic to this component
      you will need to create a service with 'expose dc/go-md2man --port=[port]' later

--> Creating resources ...
    imagestream "go-md2man" created
    buildconfig "go-md2man" created
    deploymentconfig "go-md2man" created
--> Success
    Build scheduled, use 'oc logs -f bc/go-md2man' to track its progress.
    Run 'oc status' to view your app.

>>> oc logs go-md2man-1-wpmbm
/usr/libexec/s2i/run: line 5: /opt/app-root/gobinary: No such file or directory

Build and deploy went fine, the last is the resulting pod, which fails.

Build fails if no .go files located at root

A common patten for golang projects are to have the main package within the <cmd>/<binary> folder with no .go files located in the project root. This causes a failure when attempting to perform an S2I build as the go list -f {{.Incomplete}} command fails.

Golang version tags in image

Currently, the images are tagged as latest and this makes it very difficult to figure out which version of golang is being used. It would be very useful if we could tag the images with go version.

For instance, centos/go-toolset-7-centos7:1.10 shows which version of golang is installed compared to centos/go-toolset-7-centos7/.

We use the centos image in https://github.com/golang-starters/golang-http-crud/blob/master/.openshiftio/application.yaml#L46 and there is a possibility that the project wouldn't build if the centos image was rebuilt and the go version changed from go 1.10 to 1.11.

Adding a version tag would be a minor change but it would be immensely useful.

cc @sbose78 @ALRubinger

Hardcoded point releases in imagestreams.json

The following image stream has a hardcoded value of 1.16.7.
https://github.com/sclorg/golang-container/blob/master/imagestreams/golang-rhel.json#L62

The latest image available is 1.16.12 https://catalog.redhat.com/software/containers/ubi8/go-toolset/5ce8713aac3db925c03774d1

As this repository is responsible for sycning the image streams into the Openshift clusters samples operator https://github.com/openshift/library/blob/master/arch/x86_64/official/golang/imagestreams/golang-rhel.json. The imagestreams.json needs to be up to date.

The best fix would be to introduce a 1.16 tag which can then track the point release updates however it appears the Red Hat official image does not currently have this tag and only 1.16.12 or latest.

Support for non-standard go build path

Hello, we would like to use the s2i golang library to build Go functions in Knative Functions. The function project looks like this:

❯ tree .
.
├── README.md
├── faas
│   └── main.go
├── func.yaml
├── go.mod
├── go.sum
├── handle.go
└── handle_test.go

As you can see, the main.go file is in the faas subdirectory. However, with the golang s2i builder image, there is no way to specify this in the command. A similar feature exists, for example, in paketo buildpacks, allowing developers to set the environment variable BP_GO_TARGETS, resulting in a build command that looks like this:

go build -o /layers/paketo-buildpacks_go-build/targets/bin -buildmode pie -trimpath ./faas

Could something similar be added to the golang s2i builder to enable this functionality?

go-toolset-7-golang updated to 1.10

go-toolset-7-golang was updated to version 1.10. Because of that fact tests are failing (version 1.8 is expected).

@jcajka What to do?
Tests can be fixed to expect new version. But the directory 1.8 be renamed to 1.10?

Support vendor dir in IMPORT_URL location

https://github.com/sclorg/golang-container/blob/master/1.10/s2i/bin/assemble#L36
assumes that vendor directory is referenced from INSTALL_URL only.

However vendor dir can be any higher in directory structure.
Usually it is where IMPORT_URL points.

Fix proposal:

Here is my s2i assemble overridden script:
https://github.com/matihost/learning/blob/master/go/.s2i/bin/assemble

making project supporting https://github.com/golang-standards/project-layout structure build-able.

and usage:
https://github.com/matihost/learning/blob/master/go/Makefile#L67

Builder image doesn't work out of the box

Hi, I'm trying to build https://github.com/jarifibrahim/golang-health-check/tree/without-s2i using the command

➜  golang-health-check git:(without-s2i) s2i build . centos/go-toolset-7-centos7:latest test-app                                                                   
/tmp/src ~
This is a S2I golang-1.10 centos base image:
To use it, install S2I: https://github.com/openshift/source-to-image
Sample invocation:
s2i build -e IMPORT_URL='github.com/cpuguy83/go-md2man' git://github.com/cpuguy83/go-md2man centos/golang-1.10-centos go-sample-app
You can then run the resulting image via:
docker run go-sample-app
Build completed successfully
➜  golang-health-check git:(without-s2i) docker run test-app         
/usr/libexec/s2i/run: line 5: /opt/app-root/gobinary: No such file or directory
➜  golang-health-check git:(without-s2i) 

The assemble script succeeds without any error or explanation but the built container doesn't work.

Error while starting container

Hello

I'm trying to deploy a go application with 2 external packages (gorilla mux and go-sql-driver). The deployment works but if I want to start the container, the container goes into a crash loop back off with the following error message:
/usr/libexec/s2i/run: line 5: /opt/app-root/gobinary: No such file or directory

I've also added a deployment log file if that helps.

Thank you for your help

firewallrules-3.log

Build fails for golang-starters/golang-rest-http

I am trying to build https://github.com/golang-starters/golang-rest-http project using the builder image go-toolset-7-centos7:latest but it fails with the following error.

➜  golang-rest-http git:(master) s2i build -e IMPORT_URL='github.com/golang-starters/golang-rest-http' . centos/go-toolset-7-centos7:latest test-app
/tmp/src ~
~
Assembling GOPATH
Resolving dependencies
~/go/src/github.com/golang-starters/golang-rest-http ~
~
~/go/src/github.com/golang-starters/golang-rest-http ~
Building
mv: target '/opt/app-root/gobinary' is not a directory
Build failed
ERROR: An error occurred: non-zero (13) exit code from go-toolset-custom

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.