{"id":46766969,"url":"https://github.com/tin-machine/cli-tool-docker","last_synced_at":"2026-03-09T22:38:54.584Z","repository":{"id":277806907,"uuid":"575203592","full_name":"tin-machine/cli-tool-docker","owner":"tin-machine","description":"CLI Tool Docker Environment","archived":false,"fork":false,"pushed_at":"2026-02-22T02:48:45.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T10:18:03.640Z","etag":null,"topics":["cli","development","docker"],"latest_commit_sha":null,"homepage":"","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/tin-machine.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-07T01:29:21.000Z","updated_at":"2026-02-22T02:48:49.000Z","dependencies_parsed_at":"2026-01-25T17:09:10.535Z","dependency_job_id":null,"html_url":"https://github.com/tin-machine/cli-tool-docker","commit_stats":null,"previous_names":["tin-machine/cli-tool-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tin-machine/cli-tool-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tin-machine%2Fcli-tool-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tin-machine%2Fcli-tool-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tin-machine%2Fcli-tool-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tin-machine%2Fcli-tool-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tin-machine","download_url":"https://codeload.github.com/tin-machine/cli-tool-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tin-machine%2Fcli-tool-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","development","docker"],"created_at":"2026-03-09T22:38:54.467Z","updated_at":"2026-03-09T22:38:54.563Z","avatar_url":"https://github.com/tin-machine.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cli-tool-docker\n\n通常、macなりLinuxでCLIの作業環境を作成すると環境を壊すリスクが恐ろしい。\nコンテナイメージの形で利用すると、カジュアルにアップデートなり、新しいツールの検証ができる。\nこのため自分が良く使うコマンドを集めたコンテナイメージを作る事にした。\n\n# コンテナのイメージのビルド方法\n\n```\nnerdctl build -t cli-tool-docker:latest ~/workspace/git/github.com/tin-machine/cli-tool-docker/\n```\n\n# 設定の背景\n\n## manpageが使いたかったので unminimize した、\nイメージのサイズは結構ふえる。\n\n## neovim\n\n#### コンパイルしている理由\nrafi-config が使用する razy.vim が neovim 8以上である必要がある。\n\ncopilotも利用している( [github/copilot.vim: Neovim plugin for GitHub Copilot](https://github.com/github/copilot.vim) ) によるとNeovimであれば良いらしい。\nUbuntuの標準のneovimのバージョンが8になったら素のneovimでも大丈夫か試す。\n(一方、Vimにはバージョンの縛りがある)\n\n#### neovimのビルドオプション\n[ここに説明がある](https://github.com/neovim/neovim/wiki/Building-Neovim#building)\n- Release\n- Debug\n- RelWithDebInfo\n\n# ログインするユーザの作成をどうするか?\n\nこれを行わないとコンテナに入った後、ファイルのuid:gidが実環境と異なってしまう。\nただ汎用的に使えるコンテナイメージにしたいのでユーザ名、uid、gidはDockerfileには含めたくない。\nアプローチとしては2つある。\n\n1. 汎用的なコンテナイメージを利用するDockerfileを別に作り、このDockerfileの中でuseraddする。\n2. ワンライナーやシェルスクリプトでコンテナ起動後にuseraddしてsu - ユーザ名のようにユーザを変える。\n\n作業用PCでのみ使用するので2の方法を試す。\n下記のスクリプトでは一旦、 --user 0:0 とrootでログインし、useraddを行いfishを起動している。\n\n```\n#!/bin/bash\n\nsudo nerdctl \\\n  --address /run/k3s/containerd/containerd.sock \\\n  --namespace k8s.io \\\n  run \\\n    --privileged \\\n    --network host \\\n    --volume $HOME:$HOME \\\n    --user 0:0 \\\n    -it \\\n      cli-tool-docker sh -c \\\n        \"useradd \\\n          --uid $(id -u) \\\n          --gid $(id -g) \\\n\t        --home $HOME \\\n\t        --shell /usr/bin/fish \\\n\t        $USER \u0026\u0026 \\\n\t      su - $USER\"\n```\n\n上記の検証中、下記のエラーが出ることがあった。\nsu - ユーザ名 -c fishというようにsu経由でコマンドを実行しようとするとエラーになる。\nデフォルトシェルをfishとする(useradd のオプションに --shell /usr/bin/fish 付けて起動する)事で回避できた。\n\n```\nsu - kaoru -c fish\nwarning: No TTY for interactive shell (tcgetpgrp failed)\nsetpgid: デバイスに対する不適切なioctlです\n```\n\n# docker in docker だと osxkeychain が見つからないエラーが出る\n\ndocker compose up をした際に次のエラーが出る\n\n```\nerror getting credentials - err: exec: \"docker-credential-osxkeychain\": execu table file not found in $PATH, out: \n```\n\n~/.docker/config.json に \"credsStore\": \"osxkeychain\" が記載されているので出る。\nmac環境では `bbrew install docker-credential-helpers` でインストールできるが docker in docker 内では見つからないしバイナリも提供されていない\n他の選択肢としては下記がある\n- docker-credential-pass（Linux ではこれが一般的）\n- docker-credential-secretservice（GNOME Keyring を利用）\n~/.docker/config.json を修正：\n\n```\n{\n  \"credsStore\": \"pass\"\n}\n```\n\n## 認証情報の保存場所\n\nDocker はログイン時 (docker login …) に入力した認証情報を、\ndocker-credential-pass というヘルパープログラムを通じて保存します。\nこのヘルパーは Linux の pass (Password Store) を利用して、GPG で暗号化された状態で保存します。\nつまり平文ではなく、~/.password-store/ に GPG 鍵で暗号化されて記録される\ndocker-credential-pass が呼ばれて取得・削除・一覧を行う\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftin-machine%2Fcli-tool-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftin-machine%2Fcli-tool-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftin-machine%2Fcli-tool-docker/lists"}