Docker Community Forums

Share and learn in the Docker community.

Create a docker image with dockerfile using go get repository on Code Commit?

Expected behavior

When building an image with dockerfile I’m pulling a Go repository from Code commit. I expect it to work given correct credentials

Actual behavior

It does not work, the build fails with errors saying:
package git-codecommit.eu-west-1.amazonaws.com/v1/repos/battery-historian: unrecognized import path "git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian" (parse https://git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian?go-get=1: no go-import meta tags ())

Additional Information

I have cloned and built this repository from source on my local machine: https://github.com/google/battery-historian

I then pushed the repo to our Code Commit instance. The plan is to modify parts of this application, package it into a Docker image and then run it on AWS. However, as I said, the build fails because Docker cannot authenticate against our repo on code commit. My Dockerfile looks like this;

#Use latest golang version
FROM golang:latest

MAINTAINER Me

#Install Java
RUN apt-get -y update && apt-get install -y openjdk-8-jre-headless

#Get the battery historian code and run the setup
#These links should use code commit. 
#RUN go get -d -u github.com/google/battery-historian
RUN go get -d -u git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian

WORKDIR /go/src/github.com/google/battery-historian
RUN go run setup.go

#Open default port
EXPOSE 8888

#Run the start file for battery historian in a container
CMD go run cmd/battery-historian/battery-historian.go --port 8888 --name my-battery-historian

So my question is basically:How do I use go get with HTTPS or SSH connecting to a repository on Code Commit?