ssh - 如何通过 SSH 连接到 circleci@xxx 并访问实际的构建容器?
问题描述
夏天的
我将在 CircleCI 2.0 上使用 SSH 访问构建容器。
我可以通过 SSH 连接到正在运行的作业。但用户不是 circleci@xxx。
如何通过 SSH 连接到 circleci@xxx 并访问实际的构建容器?
我试过的
- 将 SSH 密钥设置为 GitHub
❯ ssh git@github.com
PTY allocation request failed on channel 0
Hi jpskgc! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
解决方案
我得到了circleci官方的回答。
Hi,
Thanks for reaching out to us.
The container will use the default user for the image.
In this case, you are using the ubuntu:18.04 image which defaults to root.
This is because the ubuntu:18.04 is not a dedicated CircleCI convenience image.
You can check who the user is during a run by adding - run: whoami - in this instance it will return root.
The equivalent CircleCI image would be cimg/base:stable-18.04.
You can find out more information about this image here:
https://circleci.com/developer/images/image/cimg/base
As long as you SSH in via the details provided in the SSH step,
you will be accessing the container in the same way as the job is run.
Adam
Senior Support Engineer @ CircleCI
就我而言,工作目录设置在 /go/src/mordpress-simulation
jobs:
build:
working_directory: /go/src/mordpress-simulation
所以,在 cd /go/src/mordpress-simulation 之后,我得到了实际的内容。
推荐阅读
- xamarin - 如何在 Visual Studio Community 2019 版本 8.7.4 for Mac 中启用 Entity Framework Core 5 迁移
- c - CS50 径流 - 为什么我的代码中的“strcmp() 函数”实际上有效?
- docker - 使用 docker-compose 在 Gitlab CI 部署失败
- spring-boot - 如何使用 mongoTemplate 将 Mongo cli 命令转换为 spring-data-mongo 命令以进行 mongo 聚合
- python - 在 Django mysql 中提交表单时出现值错误
- python - 有没有一种方法可以将不同类的图像全部放在一个目录中,以及它们对应的类到 Keras 中?
- amazon-web-services - 如果它在 ec2 实例中运行,如何检查我的弹性搜索是否启动
- django - Dango 过滤器 - 过滤日期时间值
- arrays - 如何将一个集合划分为两个子集,使得两个集合中的数字之和之间的差异最小,而元素的总和很大?
- r - 使用数据透视函数后数据集中缺少值?