How to launch a docker container with -i -t options using TeamCity?

I am trying to start a docker container as part of the build for the linux build agent TeamCity. However, if I run a docker container with parameters -i -t, there is no way out of the executed command in the Build command.

Command line build step:

sudo docker run -i -t --name="echo_test" ubuntu echo "test"

Error building log from echo command:

Step 1/2: Command Line (1s)
   [Step 1/2] Starting: /home/ec2-user/BuildAgent/temp/agentTmp/custom_script6340936320796175009
   [Step 1/2] in directory: /home/ec2-user/BuildAgent/work/831248796cfa0a04
   [Step 1/2] Process exited with code 0

Docker container logs have output from the echo command:

[ec2-user@ip-10-28-218-103 ~]$ docker logs echo_test
test

Can someone explain why this is happening or somehow diagnose the problem?

If I change the parameters run dockereither: simple -i, simple -t, or delete them, how it works.

, sudo: sorry, you must have a tty to run sudo sudo TeamCity. Default requiretty /etc/sudoers, .


echo Build Log, -a stdout -a stderr.

:

sudo docker run -i -t -a stdout -a stderr --name="echo_test" ubuntu echo "test"

, , .

+4

All Articles