I'm working on GitLab CI/CD and I'm aware of how to redirect std error to std out in normal cases. It is to use 2>&1 or >/dev/null 2>&1.
Sometimes, I need some commands that throw errors but the errors are not critical. For an example, When I deploy my docker app, I want to stop my old container if it exists and ignore the error which will occur if the container doesn't exist.
In such case, I want to just ignore the std error and keep processes to deploy.
When I use AWS CodeDeploy, error redirecting by 2>&1 did work but in GitLab CI/CD, it doesn't work.
The following images are the errors which cancle CI/CD processes. Without the command stopping containers which doesn't exist, there is no error and deployment does work.
Question.
How can I redirect std error to std out or ignore the errors and keep deployment in GitLab CI/CD?

