coder / sail

Deprecated: Instant, pre-configured VS Code development environments.

Home Page:https://sail.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this not work with private repos?

teddy-codes opened this issue · comments

commented

I have the repo below which is private (for my home automation stuff).
image

I ran: sail run roberthmiller/home-automation
image

Any ideas what I could do here?

It should still work if your git client is configured properly.

The error you're seeing is because Sail tries to determine what language your project is written in through the github API to determine which sail base image to use if your project hasn't specified a .sail/Dockerfile.

Since this is a best effort try and the github client isn't authenticated, it will fail on private repos.

commented

This is my .sail/Dockerfile

FROM codercom/ubuntu-dev-go:latest

I just wanted the basic setup.

Edit: as a note, it does not even clone the project like it would a public repo.

Hmm, interesting, does the .sail/Dockerfile exist in ~/Projects/roberthmiller/home-automation? If not, you may need to do a git pull in your ~/Projects/roberthmiller/home-automation directory to pull the latest changes.

If the git project already exists in that directory, then it will just use the files located there and won't run git pull or anything in case you have uncommitted changes

commented

No files exist in that directory because it was not able to clone it. I think the problem is that it is private, so you cannot simply use a normal git clone without aditional setup. ie: adding keys to the image or something similar. Possibly sharing the ssh agent would be a good idea. Is this possible?

commented

Also, it clones the repo via https which is a problem for 2FA users (ssh keys are required). maybe, there should be some config for sail to allow for things such as clone via ssh an option?

It clones on the host side, outside of the container, so it should use the git client that you've configured.

You should be able to specify ssh cloning via sail run ssh://git@github.com:roberthmiller/home-automation.git

It will clone using ssh by default if a schema isn't specified though

commented

hm, so it should automatically clone via ssh if I run: sail run roberthmiller/home-automation?

Yeah it should by default if you haven't changed your sail config

commented

Hm, that is odd then.. Not sure why it did not work initially, but it seems to be fine now.

commented

Thanks for your help 😄

No problem!