Cache mounts MUST be in the format --mount=type=cache,id=, with type=bind

leon0399
HOBBY

a year ago

I get this error message even if I'm not using cache mounts.

The following image builds locally, in GitHub Actions and GitLab CI, so I'm guessing this is a bug on the Railway

How can I use a prebuilt Docker image from the GitLab registry?

FROM mlocati/php-extension-installer:2.4.0 as php-extension-installer
FROM composer:2.7.7 as composer
FROM spiralscout/roadrunner:2024.2.0 as roadrunner

FROM php:8.3-cli-alpine as php-base

RUN --mount=type=bind,from=php-extension-installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
    install-php-extensions \
        gd \
        zip \
        xsl \
        dom \
        pdo \
        exif \
        intl \
        grpc \
        pcntl \
        bcmath \
        opcache \
        sockets \
        pdo_mysql \
        pdo_pgsql \
  && apk del --no-cache ${PHPIZE_DEPS} ${BUILD_DEPENDS}

FROM php-base as production

WORKDIR /var/www

ENV COMPOSER_ALLOW_SUPERUSER=1
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY ./composer.* .

RUN composer config --no-plugins allow-plugins.spiral/composer-publish-plugin false && \
    composer install --optimize-autoloader --no-dev --no-scripts --no-interaction

COPY --from=roadrunner /usr/bin/rr /var/www

EXPOSE 8080/tcp

COPY ./ .

CMD ./rr serve -c .rr.yaml

FROM production as dev

RUN --mount=type=bind,from=php-extension-installer,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
    install-php-extensions xdebug

0 Replies

leon0399
HOBBY

a year ago

5e037d12-1a65-40b5-8a0d-4703d8052be5


a year ago

not quite a bug, but it certainly is a misleading message, railway does not support bind mounts.

gitlab is also not a support container registry.


Cache mounts MUST be in the format --mount=type=cache,id=, with type=bind - Railway Help Station