Skip to content

Commit a5f8c68

Browse files
authored
Merge pull request #117 from zonkyio/embedded-postgres-1.2.8
#116 Upgrade to Embedded Postgres 1.2.8
2 parents d0572bf + e7e9246 commit a5f8c68

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,17 +585,21 @@ If you are using `@FlywayTest` annotation, there may be several similar records
585585

586586
### Process [/tmp/embedded-pg/PG-XYZ/bin/initdb, ...] failed
587587

588-
Try to remove `/tmp/embedded-pg/PG-XYZ` directory containing temporary binaries of the embedded postgres database. That should solve the problem.
588+
Check the console output for an `initdb: cannot be run as root` message. If the error is present, try to upgrade to a newer version of the library (1.5.5+), or ensure the build process to be running as a non-root user.
589+
590+
If the error is not present, try to clean up the `/tmp/embedded-pg/PG-XYZ` directory containing temporary binaries of the embedded database.
589591

590592
### Running tests on Windows does not work
591593

592-
You probably need to install the [Microsoft Visual C++ 2013 Redistributable Package](https://support.microsoft.com/en-us/help/3179560/update-for-visual-c-2013-and-visual-c-redistributable-package). The version 2013 is important, installation of other versions does not help. More detailed is the problem discussed [here](https://github.com/opentable/otj-pg-embedded/issues/65).
594+
You probably need to install [Microsoft Visual C++ 2013 Redistributable Package](https://support.microsoft.com/en-us/help/3179560/update-for-visual-c-2013-and-visual-c-redistributable-package). The version 2013 is important, installation of other versions does not help. More detailed is the problem discussed [here](https://github.com/opentable/otj-pg-embedded/issues/65).
595+
596+
### Running tests in Docker does not work
593597

594-
### Running tests inside Docker does not work
598+
Running builds inside a Docker container is fully supported, including Alpine Linux. However, PostgreSQL has a restriction the database process must run under a non-root user. Otherwise, the database does not start and fails with an error.
595599

596-
Running build inside Docker is fully supported, including Alpine Linux. But you must keep in mind that the **PostgreSQL database must be run under a non-root user**. Otherwise, the database does not start and fails with an error.
600+
So be sure to use a docker image that uses a non-root user. Or, since version `1.5.5` you can run the docker container with `--privileged` option, which allows taking advantage of `unshare` command to run the database process in a separate namespace.
597601

598-
So be sure to use a docker image that uses a non-root user, or you can use any of the following Dockerfiles to prepare your own image.
602+
Below are some examples of how to prepare a docker image running with a non-root user:
599603

600604
<details>
601605
<summary>Standard Dockerfile</summary>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ project(':embedded-database-spring-test') {
158158
dependencies {
159159
compile project(':embedded-database-spring-test-autoconfigure')
160160

161-
compile 'io.zonky.test:embedded-postgres:1.2.7'
161+
compile 'io.zonky.test:embedded-postgres:1.2.8'
162162
compile 'org.testcontainers:postgresql:1.12.1', optional
163163
compile 'com.opentable.components:otj-pg-embedded:0.13.1', optional
164164
compile 'ru.yandex.qatools.embed:postgresql-embedded:2.10', optional

0 commit comments

Comments
 (0)