Skip to content

Commit 2d7b780

Browse files
salvo-githubbestlong
authored andcommitted
Auth file for magento 2 installation (laradock#2022)
1 parent cf6a9ba commit 2d7b780

5 files changed

Lines changed: 39 additions & 0 deletions

File tree

DOCUMENTATION/content/documentation/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,23 @@ Enabling Global Composer Install during the build for the container allows you t
15431543

15441544

15451545

1546+
<br>
1547+
<a name="Magento-2-authentication-credentials"></a>
1548+
## Magento 2 authentication credential (composer install)
1549+
1550+
1 - Open the `.env` file
1551+
1552+
2 - Search for the `WORKSPACE_COMPOSER_AUTH` argument under the Workspace Container and set it to `true`
1553+
1554+
3 - Now add your credentials to `workspace/auth.json`
1555+
1556+
4 - Re-build the Workspace Container `docker-compose build workspace`
1557+
1558+
1559+
1560+
1561+
1562+
15461563
<br>
15471564
<a name="Install-Prestissimo"></a>
15481565
## Install Prestissimo

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ services:
7878
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
7979
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
8080
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
81+
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
8182
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
8283
- INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH}
8384
- INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY}

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ DOCKER_SYNC_STRATEGY=native_osx
8282
### WORKSPACE #############################################
8383

8484
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
85+
WORKSPACE_COMPOSER_AUTH=false
8586
WORKSPACE_COMPOSER_REPO_PACKAGIST=
8687
WORKSPACE_INSTALL_NODE=true
8788
WORKSPACE_NODE_VERSION=node

workspace/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ USER root
118118
# Add the composer.json
119119
COPY ./composer.json /home/laradock/.composer/composer.json
120120

121+
# Add the auth.json for magento 2 credentials
122+
COPY ./auth.json /home/laradock/.composer/auth.json
123+
121124
# Make sure that ~/.composer belongs to laradock
122125
RUN chown -R laradock:laradock /home/laradock/.composer
123126

@@ -132,6 +135,15 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
132135
composer global install \
133136
;fi
134137

138+
# Check if auth file is disabled
139+
ARG COMPOSER_AUTH=false
140+
ENV COMPOSER_AUTH ${COMPOSER_AUTH}
141+
142+
RUN if [ ${COMPOSER_AUTH} = false ]; then \
143+
# remove the file
144+
rm /home/laradock/.composer/auth.json
145+
;fi
146+
135147
ARG COMPOSER_REPO_PACKAGIST
136148
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}
137149

workspace/auth.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"http-basic": {
3+
"repo.magento.com": {
4+
"username": "",
5+
"password": ""
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)