{"id":18458977,"url":"https://github.com/he426100/vscode-remote-containers","last_synced_at":"2025-04-08T05:34:45.116Z","repository":{"id":117340827,"uuid":"437413964","full_name":"he426100/vscode-remote-containers","owner":"he426100","description":"vscode容器开发环境","archived":false,"fork":false,"pushed_at":"2025-01-15T04:40:20.000Z","size":61,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T07:05:12.905Z","etag":null,"topics":["containers","dev-containers","docker","remote-development","remote-development-container","vscode","wsl"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/he426100.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-11T23:52:41.000Z","updated_at":"2025-01-15T04:40:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"d99b9159-8417-4854-a61d-dccda67420cd","html_url":"https://github.com/he426100/vscode-remote-containers","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/he426100%2Fvscode-remote-containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he426100%2Fvscode-remote-containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he426100%2Fvscode-remote-containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he426100%2Fvscode-remote-containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/he426100","download_url":"https://codeload.github.com/he426100/vscode-remote-containers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785919,"owners_count":20995641,"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":["containers","dev-containers","docker","remote-development","remote-development-container","vscode","wsl"],"created_at":"2024-11-06T08:21:08.536Z","updated_at":"2025-04-08T05:34:40.098Z","avatar_url":"https://github.com/he426100.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode使用Remote-Containers实现docker-php开发环境  \n\n### 使用说明  \n1. wsl下git clone  \n2. 用vscode打开文件夹：vscode-remote-containers/php/  \n3. 按f1，选择 remote-containers: Open Folder in Container (Rebuild and Reopen in Container)  \n\n### 安装扩展示例  \n```\n# install event\n# docker-php-source extract\nsudo apt update\nsudo apt install libevent-dev -y\npecl install event\ndocker-php-ext-enable event\n```\n\n### 准备和问题  \n1. 安装好[wsl2](https://docs.microsoft.com/zh-cn/windows/wsl/)及[docker](https://docs.microsoft.com/zh-cn/windows/wsl/tutorials/wsl-containers)  \n2. `mkdir ~/git` 存放源代码，挂载到容器内/workspaces/git，实现容器销毁后保留代码  \n3. `mkdir -p /etc/apache2/sites-enabled`，存放apache站点配置，挂载到容器内/etc/apache2/sites-enabled，实现容器销毁后保存站点配置  \n4. 可能会出现Open in Container失败（构建镜像失败），多半是网络问题，把Proxifier开起来就行了  \n5. 更新npm不生效可以用`su node -c \"npm install -g npm\"`  \n6. xdebug和phpcs冲突需要设置`xdebug.start_with_request = trigger`，xdebug 3.3.2需要设置`xdebug.mode = debug`才能开启单步调试，其他调试问题看官方文档[https://xdebug.org/docs/](https://xdebug.org/docs/)  \n\n### 其他  \n1. [wsl2自动启动服务并且自动更新hosts文件里的ip](https://my.oschina.net/u/2266306/blog/4561599)  \n2. [解决WSL2中Vmmem内存占用过大问题](https://my.oschina.net/u/2266306/blog/4680942)  \n3. [wsl2使用docker实现开机自启redis,mysql](https://my.oschina.net/u/2266306/blog/5354632)  \n4. [迁移wsl2到其他盘](https://github.com/pxlrbt/move-wsl)  \n5. [释放wsl2占用的磁盘空间](https://superuser.com/questions/1606213/how-do-i-get-back-unused-disk-space-from-ubuntu-on-wsl2)  \n6. [wsl2下一行命令设置 windows 代理](https://my.oschina.net/mrpzx001/blog/8510980)  \n\n### 参考资料\n\u003e [适用于 Linux 的 Windows 子系统文档](https://docs.microsoft.com/zh-cn/windows/wsl/)  \n\u003e [https://code.visualstudio.com/docs/remote/containers](https://code.visualstudio.com/docs/remote/containers)  \n\u003e [https://code.visualstudio.com/docs/remote/devcontainerjson-reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference)  \n\u003e [https://github.com/microsoft/vscode-dev-containers/blob/main/containers/php/](https://github.com/microsoft/vscode-dev-containers/blob/main/containers/php/)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhe426100%2Fvscode-remote-containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhe426100%2Fvscode-remote-containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhe426100%2Fvscode-remote-containers/lists"}