Home > Backend Development > Golang > How to Fetch a Package from a Private GitHub Repo with Go Get in a Docker Container?

How to Fetch a Package from a Private GitHub Repo with Go Get in a Docker Container?

DDD
Release: 2024-11-08 16:56:02
Original
633 people have browsed it

How to Fetch a Package from a Private GitHub Repo with Go Get in a Docker Container?

Docker: Fetching from a Private GitHub Repo with Go Get

Problem

Running go get within a Docker container to fetch a package from a private GitHub repository results in an error due to issues with the SSH public key.

Solution

To resolve the issue, use the following steps:

  • Install SSH and add your private key to the container.
  • Force go get to use SSH instead of HTTPS by adding a configuration to the container's .ssh/config file.
  • Add your private repository to the container and run go get to fetch the package.

Code

The above is the detailed content of How to Fetch a Package from a Private GitHub Repo with Go Get in a Docker Container?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template