Sign inSign up

kneerunjun/gogingonic

By kneerunjun

•Updated almost 6 years ago

Image
1

921

kneerunjun/gogingonic repository overview

  • Do you need a conatainer with Go 1.15 installed and GOPATH set ?
  • Do you need a go-gin container ?
  • Do you need the container also to have mgo driver ?

Look no further - this image is Arch Linux based where you can start quickly writing your Gin code. Here is how you can put your docker compose

version: '3.1'
services:
  eensyauth:
    image: kneerunjun/gogingonic
    volumes:
      - .:/root/go/src/app
    ports:
      - 5381:3000
    stdin_open: true
    tty:  true
    container_name: name_container
    entrypoint: ["go", "run", "main.go"]

Image defines no entrypoint, and that would be as shown in the docker-compose here. We are expecting the gin app to run on default 3000 port, but you can change to your needs.

In the same directory where you have the docker-compose you can start with main.go

package main

import (
	"fmt"

	"github.com/gin-gonic/gin"
)

func main() {
	gin.SetMode(gin.ReleaseMode)
	r := gin.Default()
	fmt.Println("This is from inside the gin service that is running inside the container")
	r.Run("0.0.0.0:3000") // listen and serve on 0.0.0.0:8080
}

Tag summary

Content type

Image

Digest

Size

395.9 MB

Last updated

almost 6 years ago

docker pull kneerunjun/gogingonic