Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderAllen/9318e67230cd0059fc99e1494ca1ce76 to your computer and use it in GitHub Desktop.
Save AlexanderAllen/9318e67230cd0059fc99e1494ca1ce76 to your computer and use it in GitHub Desktop.
Alpine Docker Image for DRUSH 9
#
# Build stage optimized with Composer packages for Drupal development.
#
FROM alexanderallen/php7-cli.core:alpine-3.11 as drush9
# Specifies which composer.json file to use for build.
ARG DRUSH_VERSION
RUN \
cd /tmp \
&& apk add --no-cache \
# REQ: Composer squizlabs/php_codesniffer 2.7.0 requires ext-tokenizer
${PHP_VERSION}-tokenizer \
# REQ: Composer drupal/coder 8.3.7 requires ext-mbstring
${PHP_VERSION}-mbstring
# Provide optional composer example to install.
COPY drush/${DRUSH_VERSION}/composer.json ${COMPOSER_HOME}/composer.json
# Install default CLI tools.
RUN composer global -vvv install
# Configure Drush 9 and above. Can be done by drush core:init instead.
# COPY common/drush.yml /root/.drush/drush.yml
# Inform PHP Code Snifer (phpcs) about Drupal coding standards sniff files.
RUN phpcs --config-set installed_paths ${COMPOSER_HOME}/vendor/drupal/coder/coder_sniffer
# Provide a dynamic entrypoint into the container.
COPY common/entrypoint.sh /root/entrypoint.sh
ENTRYPOINT ["/bin/bash"]
# SSH Agent setup.
COPY common/.bashrc /root/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment