docker-build-tools-ci icon indicating copy to clipboard operation
docker-build-tools-ci copied to clipboard

Any way to run apt to install new tools in CircleCI?

Open davereid opened this issue 5 years ago • 5 comments
trafficstars

I'd like to use this image when running things that require terminus in our CircleCI builds. But we have a need to run sudo apt update -y && sudo apt install -y dnsutils to grab our environment's log files as per https://pantheon.io/docs/logs#automate-downloading-logs. Maybe dnsutils could be provided in the build image by default?

davereid avatar Apr 01 '20 14:04 davereid

Hi @davereid! I opened https://github.com/pantheon-systems/docker-build-tools-ci/pull/53

stevector avatar Apr 08 '20 21:04 stevector

Pushed to the 6.x branch. Feedback appreciated.

greg-1-anderson avatar Apr 09 '20 01:04 greg-1-anderson

We were able to work around the original issue by replacing the dig command with getent hosts and awk which worked out of the box.

for APP_SERVER in `getent hosts appserver.$environment.$TERMINUS_SITE_UUID.drush.in | awk '{print $1}'`; do

While adding dnsutils solves the original issue (awesome, thanks for the quick fix!), I think it's still a valid point that if anything else comes up, the container is set to use an unprivileged user which cannot run anything with sudo. That seems odd compared to most containers in my experience.

davereid avatar Apr 09 '20 16:04 davereid

For example, I ran into issues mounting a prepared workspace in CircleCI to the /var/www/html directory in this Docker image, like we do in all of our other jobs. But because it was owned by the www-data user, the tester user does not have access to modify that directory.

davereid avatar Apr 09 '20 17:04 davereid