Skip to content

Commit

Permalink
feat(docker): improvment split docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBellyDev committed Jan 3, 2021
1 parent c7a7e78 commit 3c8f5c9
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ executors:
# declares a reusable executor
poser_executor_php74:
docker:
- image: pugx/poser:php74
- image: pugx/poser:php74-circleci
working_directory: ~/app

poser_executor_php80:
docker:
- image: pugx/poser:php80
- image: pugx/poser:php80-circleci
working_directory: ~/app

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/i
# install php requirements
RUN docker-php-ext-install zip iconv gd

USER circleci

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/i
# install php requirements
RUN docker-php-ext-install zip iconv gd

USER circleci

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
3 changes: 3 additions & 0 deletions .docker/circleci/php74/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM pugx/poser:php74

USER circleci
3 changes: 3 additions & 0 deletions .docker/circleci/php80/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM pugx/poser:php80

USER circleci
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@
"phpspec": "bin/phpspec run --format=pretty --ansi",
"phpspec-coverage": "bin/phpspec run -f progress -c phpspec-coverage.yml --ansi",
"behat": "bin/behat",
"docker:build:php74": "docker build -t pugx/poser:php74 -f .circleci/images/php74/Dockerfile .",
"docker:build:php74": "docker build -t pugx/poser:php74 -f .docker/base/php74/Dockerfile .",
"docker:push:php74": "docker push pugx/poser:php74",
"docker:build:php80": "docker build -t pugx/poser:php80 -f .circleci/images/php80/Dockerfile .",
"docker:push:php80": "docker push pugx/poser:php80"
"docker:build:php80": "docker build -t pugx/poser:php80 -f .docker/base/php80/Dockerfile .",
"docker:push:php80": "docker push pugx/poser:php80",
"docker:build:php74-circleci": "docker build -t pugx/poser:php74-circleci -f .docker/circleci/php74/Dockerfile .",
"docker:push:php74-circleci": "docker push pugx/poser:php74-circleci",
"docker:build:php80-circleci": "docker build -t pugx/poser:php80-circleci -f .docker/circleci/php80/Dockerfile .",
"docker:push:php80-circleci": "docker push pugx/poser:php80-circleci"
},
"extra": {
"branch-alias": {
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ services:

php74:
build:
context: docker/php74
context: .docker/development/php74
working_dir: /application
stdin_open: true
volumes:
- .:/application:cached

php80:
build:
context: docker/php80
context: .docker/development/php80
working_dir: /application
stdin_open: true
volumes:
Expand Down

0 comments on commit 3c8f5c9

Please sign in to comment.