Cloning from Private Repo (Microsoft Team Foundation Server - TFS)
- Vorherrschende Sprache
- Go
- Sterne
- 300
- Forks
- 64
- Ø Merge
- 20 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
I am having an issue cloning a repo from TFS. When using the `docker run` command I'm faced with the following errors:
### The base of my command:
```bash
docker run -it --rm \
-v /tmp/envbuilder:/workspaces \
-e ENVBUILDER_GIT_URL=https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code \
-e ENVBUILDER_INIT_SCRIPT=bash \
artifactory.example.com/docker-virtual/ghcr.io/coder/envbuilder
```
#### tls: failed to verify certificate: x509: certificate signed by unknown authority
```bash
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 👤 Using no authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": Get "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/info/refs?service=git-upload-pack": tls: failed to verify certificate: x509: certificate signed by unknown authority
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": Get "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/info/refs?service=git-upload-pack": tls: failed to verify certificate: x509: certificate signed by unknown authority: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": Get "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/info/refs?service=git-upload-pack": tls: failed to verify certificate: x509: certificate signed by unknown authority: no fallback image has been specified
```
The next step I tried was adding the extra environment variable ENVBUILDER_SSL_CERT_BASE64=ACTUAL_BASE64_CERT
#### authentication required
```bash
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 👤 Using no authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
```
The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=$PAT_TOKEN
#### unexpected client error: unexpected requesting
```bash
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 🔒 Using HTTP basic authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": unexpected client error: unexpected requesting "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/git-upload-pack" status code: 400
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": unexpected client error: unexpected requesting "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/git-upload-pack" status code: 400: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": unexpected client error: unexpected requesting "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/git-upload-pack" status code: 400: no fallback image has been specified
```
The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=$BASE64_PAT_TOKEN
#### authentication required again
```bash
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 🔒 Using HTTP basic authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
```
The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=my_tfs_username and ENVBUILDER_GIT_PASSWORD=my_tfs_password
#### authentication required again
```bash
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 🔒 Using HTTP basic authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
```
The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=oauth and ENVBUILDER_GIT_PASSWORD=$BASE64_PAT_TOKEN
This produced the authentication required error again
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Es ist keine Quelldatei oder kein Test angegeben. Beginne damit, den Docker run gegen die private TFS-URL zu reproduzieren, und verfolge dann Envbuilders Behandlung von Git clone, TLS certificate und HTTP authentication. Als erledigt gilt die Aufgabe, wenn die dokumentierten Umgebungsvariablen das Klonen des privaten Repositorys ohne Zertifikats- oder Authentifizierungsfehler ermöglichen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, git, go
- Bereich
- devops
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100