Golang runtime env variables (GOGC and GOMEMLIMIT,...)

There are several variables to change behaviour of golang binary.
waypoint-entrypoint is also golang.
As I understand it right now is deployed application is golang application.
And these variables are set on container, they not only apply to deployed application
but also to waypoint-entrypoint.
Is way to make waypoint-entrypoint ignore these variables?
GOMEMLIMIT (is not current problem waypoint is build using 1.17)

Hello there!

If I understand correctly in the scenario you describe there are environment variables set directly on the container process that are controlling the behavior of any golang binary executed in the container? And instead the desire is to only have those affect the application that waypoint-entrypoint is executing?

If this is the case, users can use Application Configuration to set environment variables that only affect the process that the waypoint-entrypoint binary is executing.

For example, consider this hypothetical application configuration:

app "example{
  config {
    env = {
      DATABASE_URL = "postgresql://example.com:5432"
      // only set GOMAXPROCS on the child process
      GOMAXPROCS = 1
  build {
    use "docker" {}

In this example, both GOMAXPROCS and DATABASE_URL will only be set for the child golang process, and will not be set in the environment that the waypoint-entrypoint is executing in.

Hopefully that answers your question, but please let us know if it does not.


1 Like

Thank you. It is clear now.
I was not sure if env part is expanded during creation of deployment or inside container.