Skip to content

Instantly share code, notes, and snippets.

@Flower7C3
Last active June 24, 2024 17:11

Revisions

  1. Flower7C3 revised this gist Jun 24, 2024. 4 changed files with 10 additions and 3 deletions.
    7 changes: 7 additions & 0 deletions blt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/usr/bin/env bash

    ## save as /usr/local/bin/blt and run `chmod +x /usr/local/bin/blt`

    docker run --platform=linux/amd64 --rm --interactive --tty \
    -v "$PWD":/app -w /app \
    cbcms/blt $@
    2 changes: 1 addition & 1 deletion composer
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ## save as /usr/local/bin/composer and run `chmod +x /usr/local/bin/composer`

    docker run --rm --interactive --tty \
    docker run --platform=linux/amd64 --rm --interactive --tty \
    --volume $PWD:/app \
    --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
    composer $@
    2 changes: 1 addition & 1 deletion drush
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@

    ## save as /usr/local/bin/drush and run `chmod +x /usr/local/bin/drush`

    docker run --rm --interactive --tty \
    docker run --platform=linux/amd64 --rm --interactive --tty \
    -v "$PWD":/app -w /app \
    drush/drush $@
    2 changes: 1 addition & 1 deletion php
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,6 @@ done

    set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters

    docker run --rm --interactive --tty \
    docker run --platform=linux/amd64 --rm --interactive --tty \
    -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
    php:$version php $@
  2. Flower7C3 created this gist Jun 24, 2024.
    8 changes: 8 additions & 0 deletions composer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/usr/bin/env bash

    ## save as /usr/local/bin/composer and run `chmod +x /usr/local/bin/composer`

    docker run --rm --interactive --tty \
    --volume $PWD:/app \
    --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
    composer $@
    7 changes: 7 additions & 0 deletions drush
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/usr/bin/env bash

    ## save as /usr/local/bin/drush and run `chmod +x /usr/local/bin/drush`

    docker run --rm --interactive --tty \
    -v "$PWD":/app -w /app \
    drush/drush $@
    23 changes: 23 additions & 0 deletions php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/usr/bin/env bash

    ## save as /usr/local/bin/php and run `chmod +x /usr/local/bin/php`

    POSITIONAL_ARGS=()
    version="8.2"
    while [ $# -gt 0 ]; do
    case "$1" in
    -V=*)
    version="${1#*=}"
    ;;
    *)
    POSITIONAL_ARGS+=("$1") # save positional arg
    ;;
    esac
    shift
    done

    set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters

    docker run --rm --interactive --tty \
    -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
    php:$version php $@