vapor/toolbox

Running Docker Image Fails on `git clone`

trufflethumb opened this issue · 5 comments

Describe the bug

I’m running the following command and stuck at “unable to access…” error as shown below.

ubuntu@ubuntu:~/code$ docker run vapor-toolbox new MyProject
Cloning template...
Error: Cloning into '/.vapor-template'...
fatal: unable to access 'https://github.com/vapor/template/': server certificate verification failed. CAfile: none CRLfile: none
ubuntu@ubuntu:~/code$ 

To Reproduce

  1. Make sure you have Docker installed.
  2. git clone https://github.com/vapor/toolbox.git
  3. cd toolbox
  4. git checkout 18.6.0
  5. docker build -t vapor-toolbox .
  6. When finished, switch to another directory such as ~/code and run docker run vapor-toolbox new MyProject

Expected behavior

The command should run without issues and I should see a directory called MyProject

Environment

Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1

  • Vapor Framework version: N/A as project is not setup
  • Vapor Toolbox version: 18.6.0
  • OS version:
    Ubuntu 20.04, AArch64

Additional context

I’ve tried this
git config --global http.sslverify false
Also this
GIT_SSL_NO_VERIFY=1

0xTim commented

@aoenth does it work of you change the Dockerfile to install ca-certificates in the run image?

It did! Thank you! I also had to configure git.

FROM swift:5.6-focal as build
WORKDIR /build
COPY . .
RUN swift build --build-path /build/.build --static-swift-stdlib -c release

FROM ubuntu:focal
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && \
    apt-get -q update && apt-get -q upgrade -y && apt-get install -y --no-install-recommends git ca-certificates \
    && rm -r /var/lib/apt/lists/*
COPY --from=build /build/.build/release/vapor /usr/bin

RUN git config --global user.name "<name>"
RUN git config --global user.email "<email>"

ENTRYPOINT ["vapor"]
0xTim commented

Awesome! The git configuration would only trigger a warning right? Fancy doing a PR to fix?

The lack of git config actually prevented vapor new from continuing. Do you want me to add that to the PR as well?

0xTim commented

Ah in that case yeah, you can default to the name as Vapor and the email as new@vapor.codes with a comment above to replace them. That would be great!