I want to create docker file using alankent/gsd image.And I'm getting authentication issue.here -i option is not working.I'm using windows 10 as a host.

how to attach my public key & private key to dockerfile?

FROM alankent/gsd
RUN cd /magento2
RUN composer require "magento/product-community-edition:2.1.0" --no-update
RUN composer update
RUN php bin/magento cache:clean
RUN php bin/magento setup:upgrade
RUN php bin/magento setup:static-content:deploy

docker build   -t sivajik34/m2upgrade .
    Sending build context to Docker daemon 2.048 kB
    Step 1 : FROM alankent/gsd
     ---> 2e0b231762c2
    Step 2 : RUN cd /magento2
     ---> Using cache
     ---> 382f13a77358
    Step 3 : RUN composer require "magento/product-community-edition:2.1.0" --no-update
     ---> Using cache
     ---> 7a380a0306c1
    Step 4 : RUN composer update
     ---> Running in 0ffb5bfab433
    Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
    Loading composer repositories with package information

      The 'https://repo.magento.com/packages.json' URL required authentication.
      You must be using the interactive console to authenticate

    update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

    The command '/bin/sh -c composer update' returned a non-zero code: 255

1 Answer 1


you can add authentifications to the ~/.composer/auth.json with the composer config command:

composer config -a -g http-basic.your.domain.com username password
  • so i need to add 'composer config -a -g http-basic.your.domain.com username password' in Dockerfile.but here what need to give http-basic.your.domain.com? Commented Sep 21, 2016 at 11:57
  • I'm using in my local system. Commented Sep 21, 2016 at 11:58
  • The domain of the repositories you want to add authentifocation for. For example repo.magento.com Commented Sep 21, 2016 at 12:11
  • now i'm getting this error: [Composer\Downloader\TransportException] The 'packagist.org/p/…' URL could not be accessed: HTTP/1.0 403 Forbidden Commented Sep 21, 2016 at 12:31
  • FWIW, Magento is working on a Docker container and it prompts you for your credentials (you might have to run Composer in interactive mode to do that). There is at least one alternative, which is to use HTTPS with a personal access token. That would probably require a credentials.yml or other file that contains the token and your GitHub URL in Docker would look something like git clone https://$1@<rest of url> Commented Sep 21, 2016 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.