How do I setup bitbucket credentials inside dockerfile to get private go modules?

  bitbucket, docker

Im trying to create the Dockerfile in order to build my golang service and push it to private Docker repository, but when I try to use Docker build, the container cannot get the other private golang packages in other private bitbucket repos

I saw that something exists for guithub private repos

FROM golang:1.14-alpine3.11 as builder
ARG GITHUB_TOKEN

RUN git config --global url.""https://${GITHUB_TOKEN}:@github.com/".insteadOf "https://github.com/

RUN go build ...
...
...
...

How can get this configuration for bitbucket inside Dockerfile

Source: Docker Questions

LEAVE A COMMENT