Vidulividuli

Go

Comprehensive information about Go app configuration.

Common Settings

The section outlines common settings and behaviours for Go projects.

Go Version

The Go version is automatically detected from go.mod file in the root directory of your project and the appropriate image is selected according to it.

The version is extracted from the go directive in go.mod. Example,

go 1.25

Ensure you use a version supported by docker golang image.

Build images

Go builds on Viduli use separate build and run images. Both stages use the same go base image.

In the future we may introduce a lightweight runtime image that may not contain the go build tools.

Environment

  • CGO_ENABLED is set to 1 for maximum compatibility with C libraries.
  • GOFLAGS is set to -buildvcs=false to disable VCS stamping (useful when building without a .git directory).

Gin

  • Base distribution: Debian 12 Bookworm
  • Default Go version: 1.25.5
  • Default image: golang:1.25.5-bookworm
  • Included packages: ca-certificates tzdata procps git curl wget nano
  • Default port: 8080

Build dependencies

Dependencies are downloaded using go mod download. You can customize this by setting the install command value in the resource build configuration.

Build command

By default, the build command is go build -o ./out/main .. The output directory defaults to out. You can customize both the build command and output directory in the resource build configuration.

Run command

The default is ./main. It can be overridden by providing the run command in the resource build configuration.

Environment

  • By default, PORT is set to 8080. If you set an expose port value in the resource build configuration, PORT is set to that value.

Secrets added to the resource are also available in the environment during the image build and run stages.

Fiber

  • Base distribution: Debian 12 Bookworm
  • Default Go version: 1.25.5
  • Default image: golang:1.25.5-bookworm
  • Included packages: ca-certificates tzdata procps git curl wget nano
  • Default port: 8080

Build dependencies

Dependencies are downloaded using go mod download. You can customize this by setting the install command value in the resource build configuration.

Build command

By default, the build command is go build -o ./out/main .. The output directory defaults to out. You can customize both the build command and output directory in the resource build configuration.

Run command

The default is ./main. It can be overridden by providing the run command in the resource build configuration.

Environment

  • By default, PORT is set to 8080. If you set an expose port value in the resource build configuration, PORT is set to that value.

Secrets added to the resource are also available in the environment during the image build and run stages.

Beego

  • Base distribution: Debian 12 Bookworm
  • Default Go version: 1.25.5
  • Default image: golang:1.25.5-bookworm
  • Included packages: ca-certificates tzdata procps git curl wget nano
  • Default port: 8080

Build dependencies

Dependencies are downloaded using go mod download. You can customize this by setting the install command value in the resource build configuration.

Build command

By default, the build command is go build -o ./out/main .. The output directory defaults to out. You can customize both the build command and output directory in the resource build configuration.

Run command

The default is ./main. It can be overridden by providing the run command in the resource build configuration.

Environment

  • By default, PORT is set to 8080. If you set an expose port value in the resource build configuration, PORT is set to that value.

Secrets added to the resource are also available in the environment during the image build and run stages.

Go (Generic)

The generic Go build option is suitable for deploying projects that are not built using a supported Go framework. If your project uses a supported framework such as Gin or Fiber, please select that option when deploying your project. By selecting the appropriate framework build, you get optimal settings that are not available when selecting the generic go option.

  • Base distribution: Debian 12 Bookworm
  • Default Go version: 1.25.5
  • Default image: golang:1.25.5-bookworm
  • Included packages: ca-certificates tzdata procps git curl wget nano
  • Default port: 8080

Build dependencies

Dependencies are downloaded using go mod download. You can customize this by setting the install command value in the resource build configuration.

Build command

By default, the build command is go build -o ./out/main .. The output directory defaults to out. You can customize both the build command and output directory in the resource build configuration.

Run command

The default is ./main. It can be overridden by providing the run command in the resource build configuration.

Environment

  • By default, PORT is set to 8080. If you set an expose port value in the resource build configuration, PORT is set to that value.

Secrets added to the resource are also available in the environment during the image build and run stages.