gomods / gomods/athens

Redirects from git repository (for example from pkg.re/check.v1) in docker container

Open
#1,306 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
4.8k
Forks
542
Avg merge
7d 21h
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**
The problem is that git redirects not follow in docker container.

**Describe the solution you'd like**
In `/etc/gitconfig` should be `followRedirects` param set.

**Describe alternatives you've considered**
Maybe exists way to serve it in app side?

**Additional context**
```console
docker run -p8000:3000 -d gomods/athens:v0.5.0
```
```console
curl -I http://localhost:8000/pkg.re/check.v1/@v/list
```
Response:
> HTTP/1.1 500 Internal Server Error
> Cache-Control: no-cache, no-store, must-revalidate
> Content-Type: application/json
> Date: Tue, 16 Jul 2019 08:52:45 GMT
Logs:
```
time="2019-07-16T08:42:18Z" level=error msg="exit status 1: go: finding pkg.re/check.v1 latest\ngo list -m pkg.re/check.v1: no matching versions for query \"latest\"\n" http-method=GET http-path=/pkg.re/check.v1/@v/list http-url=/pkg.re/check.v1/@v/list kind="Internal Server Error" module= operation=download.ListHandler ops="[download.ListHandler pool.List protocol.List vcsLister.List]" version=
```

If use dockerfile like this:
```dockerfile
FROM gomods/athens:v0.5.0

RUN echo $'[http] \n\
followRedirects = true' >> /etc/gitconfig
```
```console
docker build -t goproxy --pull -f Dockerfile .
docker run -p8000:3000 -d goproxy
```

```console
curl -I http://localhost:8000/pkg.re/check.v1/@v/list
```
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store, must-revalidate
> Content-Type: application/json
> Date: Tue, 16 Jul 2019 08:53:27 GMT

![Screenshot](https://halfi.github.io/uploads/screenshot-upload.png)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the documented docker run command and curl request for /pkg.re/check.v1/@v/list. Compare the container's /etc/gitconfig with the Dockerfile workaround that enables git redirect following. Done means the request succeeds without requiring a custom derived image.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, git, go
Domain
backend, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.