Auth file for magento 2 installation (#2022)

This commit is contained in:
salvo-github 2019-03-01 04:04:03 +01:00 committed by Shao Yu-Lung (Allen)
parent cf6a9ba2c9
commit 2d7b780e56
5 changed files with 39 additions and 0 deletions

View File

@ -1543,6 +1543,23 @@ Enabling Global Composer Install during the build for the container allows you t
<br>
<a name="Magento-2-authentication-credentials"></a>
## Magento 2 authentication credential (composer install)
1 - Open the `.env` file
2 - Search for the `WORKSPACE_COMPOSER_AUTH` argument under the Workspace Container and set it to `true`
3 - Now add your credentials to `workspace/auth.json`
4 - Re-build the Workspace Container `docker-compose build workspace`
<br>
<a name="Install-Prestissimo"></a>
## Install Prestissimo

View File

@ -78,6 +78,7 @@ services:
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
- INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH}
- INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY}

View File

@ -82,6 +82,7 @@ DOCKER_SYNC_STRATEGY=native_osx
### WORKSPACE #############################################
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
WORKSPACE_COMPOSER_AUTH=false
WORKSPACE_COMPOSER_REPO_PACKAGIST=
WORKSPACE_INSTALL_NODE=true
WORKSPACE_NODE_VERSION=node

View File

@ -118,6 +118,9 @@ USER root
# Add the composer.json
COPY ./composer.json /home/laradock/.composer/composer.json
# Add the auth.json for magento 2 credentials
COPY ./auth.json /home/laradock/.composer/auth.json
# Make sure that ~/.composer belongs to laradock
RUN chown -R laradock:laradock /home/laradock/.composer
@ -132,6 +135,15 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
composer global install \
;fi
# Check if auth file is disabled
ARG COMPOSER_AUTH=false
ENV COMPOSER_AUTH ${COMPOSER_AUTH}
RUN if [ ${COMPOSER_AUTH} = false ]; then \
# remove the file
rm /home/laradock/.composer/auth.json
;fi
ARG COMPOSER_REPO_PACKAGIST
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}

8
workspace/auth.json Normal file
View File

@ -0,0 +1,8 @@
{
"http-basic": {
"repo.magento.com": {
"username": "",
"password": ""
}
}
}