leon0399
leon0399
Explore posts from servers
RRailway
Created by leon0399 on 9/2/2024 in #✋|help
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>, with type=bind
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
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
5 replies