Questions tagged go

Explore the latest questions and answers asked by our top developers.

Cloud run cant deploy from Dockerfile from a sample github code

I am deploying a containerized application (go frontend) from here I am using the Dockerfile with just modifying line 40 of the Dockerfile as ENV GOTRACEBACK=single,PORT=8080 now i build the container image by using the docker build -t frontendapp . then deploy to google cloud run as gcloud run deploy onlinefrontendapp –image <containerimageurl> However after […]

Pass firebase private key from secret manager to cloud build container

I am building a golang application which uses the firebase admin sdk on cloud build . I created the private key(json file) and stored it in secret manager . I am declaring in my Docker file an ARG GOOGLE_APPLICATION_CREDENTIALS and on my build step of the cloudbuild.yaml I am passing the secret as an argument […]

Run GOLANG in Docker image FROM Terraform

My understanding is that the Terraform Docker image is from a Go (Golang) base image. I’m trying to build my own image using the Terraform image as a base, so I can run some custom Go commands before running my Terraform. However when I try to run Go it is not found. FROM hashicorp/terraform:1.1.3 WORKDIR […]

By gingerbreadboy
Categorised as docker, dockerfile, go, terraform Tagged , , ,

How should I configure Dockerfile for golang proj with a CA.pem file? Inside the container CA,pem can’t be found

I have a server project. Handlers provides some data from a postgres DB. For connect I have a CA.pem. When I run main.go locally – it’s working. CA.pem is in the proj folder. It’s invoked like this: pem, err := ioutil.ReadFile("CA.pem") if err != nil { fmt.Fprintf(os.Stderr, "Failed to read the CA file:%s – %s", […]

How to extract list of docker images inside GCP artifact registry

I want to list all the repositories inside GCP artifact registry in golang. Current code : c, err := artifactregistry.NewClient(ctx, option.WithCredentialsFile("<service account json>")) if err != nil { // no error here } defer c.Close() req := &artifactregistrypb.ListRepositoriesRequest{ Parent: "<project-id>", } it := c.ListRepositories(ctx, req) for { resp, err := it.Next() if err == nil […]

By Keval Bhogayata
Categorised as docker, go, google-cloud-platform Tagged , ,

Docker build for Go project with GitLab private repositories

I am having some issues getting my build to work with dependencies in private GitLab repositories. All-in-all it is a multistage build, but the stage where I am attempting to build my Go project is listed below. This works locally for me, so there is an issue somewhere getting this working in Docker: FROM golang:1.16.8-alpine3.14 […]

By el n00b
Categorised as docker, gitlab, go, ssh Tagged , , ,

Golang dynamic linking with multi-stage dockerfile

I am using Dynatrace for monitoring. As it’s says in this document i want to enable dynamic linking for my go application. But also i am usign multi-stage dockerfile. Problem is when i try to run the docker image naturally application cannot found the libraries and throws this error; Standard_init_linux.go:211 My question is how can […]

By plaborne
Categorised as docker, dynamic-linking, dynatrace, go Tagged , , ,

Handle Http Upload zip file in Golang

I’m using golang net/http package to retrieve the uploaded zip file via postman. The attachment file link. It is not dangerous file. Feel free to check out. Development env local machine m1 macbook pro golang 1.17.2 – no issue server docker image golang:1.17.5-stretch – got issue. Code to capture the post form transSourceFile file. func […]

By Chrest Koo
Categorised as docker, go, server, upload, zip Tagged , , , ,

Dockerfile fails to download module

I have the following code structure notificator | Dockerfile | go.mod | go.sum | notificator.pb.go | +– cmd | .go files +– pkg .go files The following Dockerfile builds successfully: FROM golang WORKDIR /notificator COPY . . RUN go get -t -v ./… RUN mkdir bin RUN go build -o bin ././… RUN chmod +x […]

By Chanonry
Categorised as docker, go Tagged ,

Execing docker image entrypoint, which is a compiled go app, fails with "not found"

I have built a small Go app and done local testing of it on my Linux VM. I’m now trying to build a prototype Docker image for it and test running the image. The Dockerfile structure is pretty simple. I base it on Alpine, copy the executable to the root directory and my entrypoint is […]

By David M Karr
Categorised as docker, go, linux Tagged , ,
1 2 3 61

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us