Access and debug Circle CI Docker container with ssh

Introduction

There was a case that the test that passed locally did not pass on CircleCi, so I connected it to the CircleCi container with ssh and debugged. Generally, it is as Official, but I think that there may be some supplements, so I will leave the procedure at that time. I will. It's a windows environment, so don't be afraid.

Premise

--It is assumed that ssh cannot be used. --If you haven't done so already, please refer to here. --It is assumed that you also have an account on github and CircleCi.

Preparation

To connect to CircleCi with ssh, you need to be able to connect to github with ssh. I think you should set it referring to here.

Restart the container to be debugged with ssh enabled

Access CircleCi and select "Rerun Job With SSH" for the Job you want to debug. You should select Job instead of WorkFlow.

image.png

The Enable SSH step is added to start the workflow as shown below. The port number and host ip address are displayed in the white frame below, so use this to connect to the container with ssh.

無題.png

Connect to container with ssh

Connect to the container with ssh based on the information displayed earlier. If you are asked if you want to connect on the way, just answer yes.

ssh -p <port> <ip address>

Now that you are connected to the container, you should be able to get various information necessary for debugging. You can also download the container files and directories by using the following scp while returning to local.

scp -r -P <port> root@<ip address>:<The path of the directory you want to copy> <Local download destination path>

At the end

Even if I use Docker, the results on CircleCi may be different from those on Local and CircleCi, and I debug at that time. In the first place, I would like to learn about Docker and OS so that debugging is not necessary.

Recommended Posts

Access and debug Circle CI Docker container with ssh
CI / CD Docker container monitoring
Hello World with Docker and C
Microservices With Docker and Cloud Performance
[Linux] Start Apache container with Docker
Build WebRTC Janus with Docker container
About Docker, disguise server and container
Build debug environment on container --Build local development environment for Rails tutorial with Docker-
Starting with installing Docker on EC2 and running Yellowfin in a container
Debug with VSCode + Next.js + Docker (+ Chrome) (supports both server side and client side)
Building Rails 6 and PostgreSQL environment with Docker
Kind @ Mac in Docker and vctl container
Communicate Gitlab and Gitlab Runner launched with Docker
Monitor the Docker container and SystemD process on the same host with Zabbix on Ubuntu.
How to build a Jenkins server with a Docker container on CentOS 7 of VirtualBox and access the Jenkins server from a local PC
Experience .NET 5 with Docker and Visual Studio Code
[Docker] Check the running container and enter there
IDE and Maven compile with all debug information
Setting to exit from Docker container with VScode
Create jupyter notebook with Docker and run ruby
Edit Docker Container in VSCode multi-stage SSH Vagrant
Update container image with KUSANAGI Runs on Docker
Prepare a scraping environment with Docker and Java
Docker Container Operations with Docker-Client API for Java
Try using another Servlet container Jetty with Docker
Create a Java (Gradle) project with VS Code and develop it on a Docker container
[Docker] How to update using a container on Heroku and how to deal with Migrate Error
Create a Java (Maven) project with VS Code and develop it on a Docker container