# Problem with Sudo in Docker Container

**URL:** <https://forums.docker.com/t/problem-with-sudo-in-docker-container/127518>\
**Category:** General\
**Created:** [August 4, 2022, 11:25pm UTC](https://forums.docker.com/t/problem-with-sudo-in-docker-container/127518 "2022-08-04T23:25:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeaw2010](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/mikeaw2010/32/32512_2.png) [@mikeaw2010](https://forums.docker.com/u/mikeaw2010)\
**Post date:** [August 4, 2022, 11:25pm UTC](https://forums.docker.com/t/problem-with-sudo-in-docker-container/127518/1 "2022-08-04T23:25:19Z")

</div>

Hello. I am having problems deploying my pipeline on a docker container.  
The initial error was that the command ‘sudo’ was not found:  
Executing “step\_script” stage of the job script

```auto
$ whoami

gitlab-runner
$ sudo apt-get update -y -qq

bash: line 105: sudo: command not found
Cleaning up project directory and file based variables
ERROR: Job failed: exit status 1

```

I went into the bash of the container and downloaded sudo… Now I am receiving a new error:

```auto
Executing "step_script" stage of the job script
$ sudo apt-get update -y -qq

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
Cleaning up project directory and file based variables

```

Is any special configuration needed to get sudo to work in a container?

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [August 5, 2022, 4:58pm UTC](https://forums.docker.com/t/problem-with-sudo-in-docker-container/127518/2 "2022-08-05T16:58:50Z")

</div>

Either include required package in your runner image and add the gitlab-runner user to your sudoers list to bypass the need to enter a password (and keep this image updated! by rebuilding it once a week or more/less frequently), or make sure your image is started as root user.
