3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dockerfile内でGitHubのprivate repositoryからcloneする

Posted at

概要

DockerのSSH mountsを使うことで簡単にprivate repositoryのclone(のようなこと)ができる

前提

ホストPC上でGitHubへのSSH接続での認証設定を完了しておく必要がある(はず)

手順

ADD命令を使って、レポジトリをマウントする

具体的には、以下のようにする(/src配下にcloneしている)

FROM alpine
ADD git@github.com:me/myprivaterepo.git /src/

また、ビルドコマンド実行時に、--ssh defaultオプションをつける

docker build --ssh default .

参考

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?