Problem with Sudo in Docker Container

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

$ 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:

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?

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.