skip to Main Content

I’m able to build the image locally in my machine (Docker version 20.10.18), but failing in Bitbucket pipeline for an environment using Docker version 20.10.8.
Eveything works fine for image php:8.0-fpm but not for php:8.3-fpm.

Detailed error message here

Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [169 kB]

Fetched 9225 kB in 1s (9126 kB/s)

Reading package lists...

E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'

E: Sub-process returned an error code

The command '/bin/sh -c curl -fsSL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash -     && apt update && apt install -y git     cron     default-mysql-client     build-essential     gnupg     jpegoptim optipng gifsicle pngquant     libjpeg-dev libfreetype-dev libpng-dev     zlib1g-dev libzip-dev     openssh-client     libicu-dev     nodejs     gosu     gettext-base     brotli     unzip     apache2 libapache2-mod-fcgid     && docker-php-ext-configure zip     && docker-php-ext-configure gd --with-freetype --with-jpeg     && docker-php-ext-configure pcntl --enable-pcntl     && docker-php-ext-install gd mysqli pdo_mysql zip opcache bcmath exif intl pcntl' returned a non-zero code: 100

ERROR: Service 'workspace' failed to build : Build failed

This is my Dockerfile

ARG PHP_VERSION
FROM php:${PHP_VERSION}-fpm AS base-image

ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS=0 
    PHP_OPCACHE_MAX_ACCELERATED_FILES=20000 
    PHP_OPCACHE_MEMORY_CONSUMPTION=256 
    APACHE_DOCUMENT_ROOT=/code/htdocs

ARG NODEJS_VERSION
RUN curl -fsSL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash - 
    && apt update && apt install -y git 
    cron 
    default-mysql-client 
    build-essential 
    gnupg 
    jpegoptim optipng gifsicle pngquant 
    libjpeg-dev libfreetype-dev libpng-dev 
    zlib1g-dev libzip-dev 
    openssh-client 
    libicu-dev 
    python3 
    nodejs 
    gosu 
    gettext-base 
    brotli 
    unzip 
    python3-pip 
    apache2 libapache2-mod-fcgid 
    && docker-php-ext-configure zip 
    && docker-php-ext-configure gd --with-freetype --with-jpeg 
    && docker-php-ext-configure pcntl --enable-pcntl 
    && docker-php-ext-install gd mysqli pdo_mysql zip opcache bcmath exif intl pcntl

2

Answers


  1. Chosen as BEST ANSWER

    Solution to the problem : Update Docker version.


  2. I’d suspect the curl https://remote-script | bash - && more-commands is not being properly associated. I’d try

    RUN (curl -fsSL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash - ) 
        && apt update && apt install -y 
        git 
        cron 
        default-mysql-client 
        # etc...
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search