Using Go artifact repositories
To configure Go in a restricted environment, use the
GOPROXY environment variable and the Athens module datastore and proxy.
Athens is a Go module datastore and proxy with many configuration options. It can be configured to act only as a module datastore and not as a proxy. An administrator can upload their Go modules to the Athens datastore and have them available across their Go projects. If a project tries to access a Go module that is not in the Athens datastore, the Go build fails.
To work with Athens, configure the
GOPROXYenvironment variable in the devfile of your CLI container:
components: - mountSources: true type: dockerimage alias: go-cli image: 'quay.io/eclipse/che-golang-1.12:7.7.0' ... - value: /tmp/.cache name: GOCACHE - value: 'http://your.athens.host' name: GOPROXY
Internal artifact repositories often do not have a self-signed TLS certificate signed by an authority that is trusted by default. They are usually signed by an internal company authority or are self-signed. Configure your tools to accept these certificates.
Go uses certificates from a file defined in the
SSL_CERT_FILE environment variable.
Obtain the certificate used by the Athens server in the Privacy-Enhanced Mail (PEM) format. It is customary for administrators to provide certificates of internal artifact servers as Kubernetes secrets (see Importing untrusted TLS certificates to Che). The relevant server certificates will be mounted in
/public-certsin every container in the workspace.
Add the appropriate environment variables to your devfile:
components: - mountSources: true type: dockerimage alias: go-cli image: 'quay.io/eclipse/che-golang-1.12:7.7.0' ... - value: /tmp/.cache name: GOCACHE - value: 'http://your.athens.host' name: GOPROXY - value: 'on' name: GO111MODULE - value: '/public-certs/athens-server.cer' name: SSL_CERT_FILE