We have a custom docker container we are using for testing and building, but the script in the first step its not executing, it just tells me that it did the build setup and build teardown but nothing else... I tried so set a workdir (/root) in the container, put most apt commands in one RUN command but to no avail,
What baffles me the most is that all other containers run fine and execute the steps properly like the google sdk alpine image
The parts that failing in our bitbucket-pipelines.yml
- step:
name: Install Dependencies
script:
- composer install
caches:
- composer
- vendor
- step:
name: Test
script:
- /vendor/bin/phpunit
caches:
- composer
- vendor
This is our current test container setup
FROM ubuntu:20.04
WORKDIR /root
# Install PHP & NodeJS
RUN apt update && \
apt upgrade --yes --no-install-recommends &&\
apt install \
software-properties-common \
curl \
tzdata \
--no-install-recommends \
--yes && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
add-apt-repository ppa:ondrej/php && \
apt install \
php8.0-bcmath \
php8.0-common \
php8.0-cli \
php8.0-curl \
php8.0-gd \
php8.0-imagick \
php8.0-intl \
php8.0-mbstring \
php8.0-mysql \
php8.0-opcache \
php8.0-imagick \
php8.0-readline \
php8.0-redis \
php8.0-soap \
php8.0-xml \
php8.0-zip \
nodejs \
git \
--no-install-recommends \
--yes && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# Install PHP tools
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
USER nobody
ENV HOME /root
VOLUME ["/root"]
CMD ["bash"]
Hi Tigo and welcome to the community!
I've built a Docker image based on the Dockerfile you posted here and I see the same issue. The issue gets resolved if I remove the following line from the Dockerfile:
USER nobody
So, this seems to be the culprit, I suspect because Pipelines by default runs as root.
Are you able to use the image if you remove that from the Dockerfile?
Kind regards,
Theodora
Thank you for your suggestion!
It was indeed the problem...
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome, I'm glad to have helped.
Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.