You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=> CACHED [ 65/111] RUN if [ false=true ];then composer global require "laravel/installer";fi 0.0s
=> [ 66/111] RUN if [ https://mirrors.aliyun.com/composer/ ];then composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ ;fi 257.9s
There are two point about composer config in the Dockerfile of workspace. The first is successful,but the Second hangs.
the difference is the first's USER is laradock, the second's USER is root.
Dockerfile as follows
############################################################################ Composer:###########################################################################USER root
# Add the composer.jsonCOPY ./composer.json /home/laradock/.composer/composer.json
# Add the auth.json for magento 2 credentialsCOPY ./auth.json /home/laradock/.composer/auth.json
# Make sure that ~/.composer belongs to laradockRUN chown -R laradock:laradock /home/laradock/.composer
# Export composer vendor pathRUN echo "" >> ~/.bashrc && \
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc
# Update composerARG COMPOSER_VERSION=2
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
RUN set -eux; \
if [ "$COMPOSER_VERSION" = "1" ] || [ "$COMPOSER_VERSION" = "2" ]; then \
composer self-update --${COMPOSER_VERSION}; \
else \
composer self-update ${COMPOSER_VERSION}; \
fi
USER laradock
# Check if global install need to be ranARG COMPOSER_GLOBAL_INSTALL=false
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
# run the install
composer global install \
;fi
# Check if auth file is disabledARG COMPOSER_AUTH_JSON=false
ENV COMPOSER_AUTH_JSON ${COMPOSER_AUTH_JSON}
RUN if [ ${COMPOSER_AUTH_JSON} = false ]; then \
# remove the file
rm /home/laradock/.composer/auth.json \
;fi
ARG COMPOSER_REPO_PACKAGIST
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}
RUN if [ ${COMPOSER_REPO_PACKAGIST} ]; then \
composer config -g repo.packagist composer ${COMPOSER_REPO_PACKAGIST} \
;fi
# Export composer vendor pathRUN echo "" >> ~/.bashrc && \
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc
...
############################################################################ Laravel Installer:###########################################################################USER laradock
ARG INSTALL_LARAVEL_INSTALLER=false
RUN if [ ${INSTALL_LARAVEL_INSTALLER} = true ]; then \
# Install the Laravel Installer
composer global require "laravel/installer" \
;fi
USER root
ARG COMPOSER_REPO_PACKAGIST
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}
RUN if [ ${COMPOSER_REPO_PACKAGIST} ]; then \
composer config -g repo.packagist composer ${COMPOSER_REPO_PACKAGIST} \
;fi
Description:
docker-compose build workspace
hangs as followsThere are two point about
composer config
in theDockerfile
of workspace. The first is successful,but the Second hangs.the difference is the first's
USER
islaradock
, the second'sUSER
isroot
.Dockerfile
as followsExpected Behavior:
build successfully
Context information:
Output of
git rev-parse HEAD
Output of
docker version
Client: Cloud integration: v1.0.31 Version: 23.0.5 API version: 1.42 Go version: go1.19.8 Git commit: bc4487a Built: Wed Apr 26 16:12:52 2023 OS/Arch: darwin/arm64 Context: default Server: Docker Desktop 4.19.0 (106363) Engine: Version: 23.0.5 API version: 1.42 (minimum version 1.12) Go version: go1.19.8 Git commit: 94d3ad6 Built: Wed Apr 26 16:17:14 2023 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.20 GitCommit: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc: Version: 1.1.5 GitCommit: v1.1.5-0-gf19387a docker-init: Version: 0.19.0 GitCommit: de40ad0
Output of
docker-compose version
System info: Mac, Windows or Linux. Include which disto/version
Steps to reproduce the issue:
Stacktrace & Additional info:
.env file as follows
The text was updated successfully, but these errors were encountered: