I picked the sample above and pasted it in a pipeline, but was not able to execute the pipeline. The error I get when I use the nginx and redis pipeline is when the apt get command is run.
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/683b6fb6-dbe3-4dea-a205-d102ee22e8bf.sh
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
/home/vsts/work/_temp/683b6fb6-dbe3-4dea-a205-d102ee22e8bf.sh: line 2: psql: command not found
On changing the command to run as sudo, the challenge is Ubuntu 16 onwards does not have sudo installed and since apt-get does not work cannot install it either. As a workaround I am using the vsts ubuntu 14.04 image but that increases the build time.
The documentation needs to be corrected or please identify if I am doing something wrong.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@thomps23 please assign to @dakale
I got the same problem here
It seems that I can define 'services' only under 'jobs' according to the document about YAML schema ( https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#server )
So I think those examples in this article don't work in the first place. (Actually, it didn't on my env.)
How did you guys write your .yml?
The following didn't work for me:
resources:
containers:
The container job example does not work because the ubuntu container is not running as root user so you can't run apt-get. It would be nice if the examples were valid
This issue hasn't been updated in more than 180 days, so we've closed it. If you feel the issue is still relevant and needs fixed, please reopen it and we'll take another look. We appreciate your feedback and apologize for any inconvenience.
The documentation is still wrong.
Most helpful comment
The container job example does not work because the ubuntu container is not running as
rootuser so you can't runapt-get. It would be nice if the examples were valid