WGET symfony installer in a dockerfile

I am just trying to get the symfony installer inside my PHP-Dockerfile. As mentioned on the symfony homepage, you should get the symfony installer like this:

 wget https://get.symfony.com/cli/installer -O - | bash 

Now I simply paste this command in my Dockerfile like this:

# docker/php-fpm/Dockerfile

FROM php:7.3.0-fpm-alpine
COPY wait-for-it.sh /usr/bin/wait-for-it

# include scripts and set locale
RUN apk add --no-cache bash  
    && chmod +x /usr/bin/wait-for-it 
    && apk --update --no-cache add git 
    && apk --update add tzdata acl logrotate 
    && ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime 
    && date 
    && rm -rf /var/cache/apk/*


# */
# get composer, see: https://docs.docker.com/develop/develop-images/multistage-build/
COPY --from=composer /usr/bin/composer /usr/bin/composer

# Install tools
RUN set -x && 
    apk --update add 
    sudo 
    bash 
    wget 
    icu 
    icu-libs 
    icu-dev 
    freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev 
    && docker-php-ext-configure intl 
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
    && docker-php-ext-install 
    iconv 
    intl 
    pdo 
    pdo_mysql 
    mbstring 
    opcache 
    && rm -rf /var/cache/apk/*

# */
WORKDIR /var/www
# this does not work:
CMD cd /root ; wget https://get.symfony.com/cli/installer -O - | bash ;
# this works:
CMD composer install ; wait-for-it database:3306 -- bin/console doctrine:migrations:migrate ;  php-fpm ;
EXPOSE 9000

but nothing happens. Can anybody tell me, why docker does not execute it as if I paste the command in my shell? I can’t see the install-routine, neither any binaries in my home-dir.

The ouptut when creating my image is as follows (i know root is not a good idea, but it’s for testing, please forgive me):

Step 7/9 : CMD cd /root ; wget https://get.symfony.com/cli/installer -O - | bash ;
 ---> Running in 34883cf2b303
Removing intermediate container 34883cf2b303
 ---> 472999b3805f

Can anybody explain this behaviour? What do I have to do, get my symfony binaries?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *