You’re using the official Node Docker image which is based on a Docker image called
buildpack-deps (specifically, the Debian Jessie version). The buildpack Docker image does not have
sudo installed, which is not surprising since most Docker images run as root by default until told to switch to another user and group.
Since the Node Docker image doesn’t switch the user or group (though it does create both), you’re actually still running as root throughout the execution of the steps. In other words, you should be able to remove
sudo and it will work just fine.
If you would like to use
sudo, you’ll either need a separate
run step or create a Docker image on top of the Node image that contains
- run: apt-get install -y sudo
RUN apt-get install -y sudo
As an aside, based on your configuration file above, it looks like you’re trying to use both Node and Ruby in the steps. I believe you’ll run into an issue because your commands are going to execute inside the container based on Node; the Ruby and Redis images will be loaded separately. What you probably want to do instead is create a custom image that includes both Node and Ruby. That will allow you to call both Ruby and Node commands.