Skip to content

Commit

Permalink
Merge pull request #239 from creative-commoners/pulls/master/docker-f…
Browse files Browse the repository at this point in the history
…or-guy

MNT Update docker to work for Guy
  • Loading branch information
GuySartorelli committed Mar 3, 2023
2 parents cf476b0 + c689c89 commit 027abd0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions docker/.env → docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
XDEBUG_HOST=localhost
XDEBUG_PORT=9000
GITHUB_API_TOKEN=""
14 changes: 7 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.4-cli as php
FROM php:8.1-cli as php

RUN apt-get update -y \
&& apt-get install -y \
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
FROM php as base

RUN apt-get update -y \
&& apt-get install -y git python3-pip openssh-client \
&& apt-get install -y git python3-pip openssh-client gpg \
&& apt-get install -y ruby \
&& gem install yamlclean

Expand All @@ -61,9 +61,9 @@ RUN composer -vvv global require silverstripe/cow:${COW_VERSION} \
&& chmod 755 /root \
&& ln -s /root/.composer/vendor/bin/cow /usr/bin/. \
&& groupadd -f -g ${GROUP_ID} cow \
&& useradd -g ${GROUP_ID} -d /home/cow -m -u ${USER_ID} cow \
&& mkdir -p /home/cow/.composer/cache \
&& chown -R cow:cow /home/cow/.composer
&& useradd -g ${GROUP_ID} -d /home/cow -m -u ${USER_ID} cow
# && mkdir -p /home/cow/.cache/composer/cache \
# && chown -R cow:cow /home/cow/.cache/composer

USER cow
WORKDIR /home/cow
Expand All @@ -76,6 +76,6 @@ FROM stable as debug

USER root
RUN docker-php-source extract \
&& yes '' | pecl install xdebug-2.9.8 && docker-php-ext-enable xdebug \
&& yes '' | pecl install xdebug && docker-php-ext-enable xdebug \
&& docker-php-source delete
USER cow
USER cow
4 changes: 2 additions & 2 deletions docker/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ docker_compose_params()
docker_compose_run()
{
cd $DOCKER_DIR && \
docker-compose run --rm $(docker_compose_params) $EXTRA_FLAGS $1 ${@:2}
docker compose run --rm $(docker_compose_params) $EXTRA_FLAGS $1 ${@:2}
}

docker_compose_pull()
{
cd $DOCKER_DIR && \
GIT_CONFIG=$GIT_CONFIG USER_ID=$USER_ID GROUP_ID=$GROUP_ID docker-compose build --pull $1 ${@:2}
GIT_CONFIG=$GIT_CONFIG USER_ID=$USER_ID GROUP_ID=$GROUP_ID docker compose build --pull $1 ${@:2}
}

if [ ! -z "$SKIP_RUN_EXEC" ] ; then
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ services:
network_mode: 'host'
volumes: *volumes
entrypoint: *entrypoint
environment: *environment
environment: *environment
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ if [ ! -z "$COW_MODE_PHPCS" ] ; then
exit;
fi

$DIR/bin/cow $@
$DIR/bin/cow $@
3 changes: 3 additions & 0 deletions docker/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ARG GROUP_ID=${GROUP_ID}

USER root

RUN apt-get update -y \
&& apt-get install -y gpg

# Sync the user id and group id with the host machine
RUN usermod -u ${USER_ID} -g ${GROUP_ID} cow && chown -R cow:cow /home/cow

Expand Down

0 comments on commit 027abd0

Please sign in to comment.