{"id":20487431,"url":"https://github.com/zenizh/docker-sshd_ready","last_synced_at":"2026-07-03T19:04:27.553Z","repository":{"id":19908354,"uuid":"23173847","full_name":"zenizh/docker-sshd_ready","owner":"zenizh","description":"Dockerfile created in order to use ssh.","archived":false,"fork":false,"pushed_at":"2014-08-22T13:33:37.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T04:47:38.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zenizh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-21T04:11:27.000Z","updated_at":"2016-07-01T17:36:31.000Z","dependencies_parsed_at":"2022-08-21T15:41:09.836Z","dependency_job_id":null,"html_url":"https://github.com/zenizh/docker-sshd_ready","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenizh%2Fdocker-sshd_ready","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenizh%2Fdocker-sshd_ready/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenizh%2Fdocker-sshd_ready/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenizh%2Fdocker-sshd_ready/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenizh","download_url":"https://codeload.github.com/zenizh/docker-sshd_ready/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242066652,"owners_count":20066744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T16:42:02.346Z","updated_at":"2025-10-30T07:48:23.063Z","avatar_url":"https://github.com/zenizh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker-sshd_ready\n\nsshd readyなイメージを作成するDockerfileです。\nJenkins+Chef Solo+serverspecでCIするときのコンテナとしての利用を想定しています。\n\n[公式のCentOSイメージ](https://registry.hub.docker.com/_/centos/)を元に作成しています。\n\n## Usage\n\n### 1. CentOSイメージの取得\n\n```\n$ sudo docker pull centos:centos6\n```\n\n### 2. 公開鍵の準備\n\nDockerfileと同じディレクトリに公開鍵を`authorized_keys`という名前で配置してください。\nこれがコンテナ内の`/root/.ssh`以下に配置されます。\n\n### 3. イメージを作成\n\n最後の`.`を忘れないようにしてください。\n\n```\n$ sudo docker build -t {image_name} .\n```\n\n### 4. コンテナを実行\n\n`--privileged`オプションは、これがないと`iptables`などいくつかの設定がうまくいかないので設定しています。\n詳しくは[ドキュメント](http://docs.docker.com/reference/run/#runtime-privilege-linux-capabilities-and-lxc-configuration)を参照してください。\n\n```\n$ sudo docker run -d -p 22 -t --privileged --name {container_name} {image_name}\n```\n\n### 5. ssh接続\n\n秘密鍵へのパスは適宜変更してください。\n\n```\n$ ssh -p 22 -i ~/.ssh/id_rsa root@`sudo docker inspect --format='{{ .NetworkSettings.IPAddress }}' {container_name}`\n```\n\n上記において、以下の部分はコンテナのIPアドレスを取得しています。\n\n```\n$ `sudo docker inspect --format='{{ .NetworkSettings.IPAddress }}' {container_name}`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenizh%2Fdocker-sshd_ready","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenizh%2Fdocker-sshd_ready","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenizh%2Fdocker-sshd_ready/lists"}