Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1398 from versionpress/1389-image-digests
Browse files Browse the repository at this point in the history
Use digests for Docker images
  • Loading branch information
borekb authored Mar 10, 2019
2 parents 341fec0 + 6c956a9 commit 29fa978
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dev-env/wordpress-cli-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM wordpress:cli
FROM wordpress:cli@sha256:f8600f5df710c0973ed250e16c1286de7f8344cd8ce0dcba3779931010e956d4

# IMPORTANT: this image is Apline-based where www-data is UID 82 while in Debian-based WordPress image,
# it's 33. Both will be reading and writing to `/var/www/html` so we'll be using UID 33 in this Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion dev-env/wordpress-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM wordpress:php7.2-apache
FROM wordpress:php7.2-apache@sha256:08c71170cdd4427d155906f8eb0e715768c133f836780c97b0e3cc3e7c1288e2

# Install prerequisites for WP-CLI & VersionPress
RUN apt-get update \
Expand Down
17 changes: 6 additions & 11 deletions docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.6'
services:

wordpress-for-tests:
image: versionpress/wordpress:php7.2-apache
image: versionpress/wordpress:php7.2-apache@sha256:64b3c10adfef9ae65a140d5547d670d996c5c852b9a840c71a86a5be4f777fdc
ports:
- "80:80"
volumes:
Expand All @@ -14,22 +14,17 @@ services:
WORDPRESS_DB_PASSWORD: r00tpwd

mysql-for-tests:
image: mysql:5.7
image: mysql:5.7@sha256:1590f2540fd87e39605686873fb10206da4cbd7e83df2bc4110abe9fb740699e
ports:
- "3306:3306"
volumes:
- db-data-for-tests:/var/lib/mysql:z
environment:
MYSQL_ROOT_PASSWORD: r00tpwd

adminer:
image: adminer
ports:
- "8099:8080"

# See `tests-with-wordpress` for a service that also starts WordPress.
tests:
image: versionpress/wordpress:cli
image: versionpress/wordpress:cli@sha256:86fc95921f1ac48950ab593b0b970e9a98ad3b28c0b16c5c6007ea0fac2839e9
environment:
VP_DIR: /opt/versionpress
PHP_IDE_CONFIG: serverName=VersionPress-tests
Expand All @@ -44,7 +39,7 @@ services:
command: ../vendor/bin/phpunit --verbose --colors -c phpunit.xml --testdox-text /var/opt/versionpress/logs/testdox.txt

tests-with-wordpress:
image: versionpress/wordpress:cli
image: versionpress/wordpress:cli@sha256:86fc95921f1ac48950ab593b0b970e9a98ad3b28c0b16c5c6007ea0fac2839e9
environment:
VP_DIR: /opt/versionpress
PHP_IDE_CONFIG: serverName=VersionPress-tests
Expand All @@ -63,10 +58,10 @@ services:

selenium-hub:
# Standalone Firefox is enough but could also be a full grid setup, hence the service name
image: selenium/standalone-firefox
image: selenium/standalone-firefox@sha256:541e4d726136b3fbf0220c1feb4d3a76c577d302e77050f1191a0d5b3a029c10

copy-files-to-host:
image: alpine
image: alpine@sha256:644fcb1a676b5165371437feaa922943aaf7afcfa8bfee4472f6860aad1ef2a0
volumes:
- wordpress-files:/tmp/wp
- ./dev-env/wp-for-tests:/tmp/wp-copy
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.6'
services:

wordpress:
image: versionpress/wordpress:php7.2-apache
image: versionpress/wordpress:php7.2-apache@sha256:64b3c10adfef9ae65a140d5547d670d996c5c852b9a840c71a86a5be4f777fdc
ports:
- "80:80"
volumes:
Expand All @@ -15,7 +15,7 @@ services:
WORDPRESS_DB_PASSWORD: r00tpwd

mysql:
image: mysql:5.7
image: mysql:5.7@sha256:1590f2540fd87e39605686873fb10206da4cbd7e83df2bc4110abe9fb740699e
ports:
- "3306:3306"
volumes:
Expand All @@ -24,7 +24,7 @@ services:
MYSQL_ROOT_PASSWORD: r00tpwd

adminer:
image: adminer
image: adminer@sha256:0e245b5550d7710ebfe728e682804947e2edade4d7f3313e7066b4629b728c5c
ports:
- "8099:8080"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL",
"scripts": {
"init-dev": "ts-node scripts/init-dev.ts",
"refresh-dev": "git clean -fxd && npm i && docker-compose pull",
"refresh-dev": "git clean -fxd && npm i",
"init-phpstorm": "ts-node scripts/init-phpstorm.ts",
"build": "ts-node scripts/build.ts",
"start": "docker-compose up -d wordpress",
Expand Down

0 comments on commit 29fa978

Please sign in to comment.