Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Docker tips and enhancements #19

Closed
ghost opened this issue Jan 9, 2017 · 1 comment
Closed

Some Docker tips and enhancements #19

ghost opened this issue Jan 9, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 9, 2017

Hi,

I just would like to give you some feedbacks about your docker integration.

RUN apt-get update && apt-get install -y \
    git \
    vim \
    bzip2 \
    zip \
    libbz2-dev \
    libmcrypt-dev \
    libicu-dev \
    && docker-php-ext-configure mysqli \
    && docker-php-ext-install mysqli pdo_mysql bz2 mcrypt intl
  • You can add && rm -rf /var/lib/apt/lists/*at the end to remove some cached files... you will save few MB on your images.

RUN rm -rf /var/app/.git

  • This is not the right way to remove data because they will still present in the previous layer. You should use .dockerignore file to exclude that directory.
RUN cd /var/app; \
    /usr/bin/composer update; \
./scripts/post-create-project
  • You should use && for chaining commands to avoid silent failures. In general you can use that also for reducing the number of layers by reducing the number of RUNinstructions.

Thanks.

@Pierozi
Copy link
Contributor

Pierozi commented Jan 9, 2017

Hello @nasskach

Thanks to you for taking time to share theses enhancement.
I will perform change as soon as possible and let you review.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant