Skip to content

[RFR] fix docker setup for dev env#580

Merged
nicolasmure merged 2 commits intomasterfrom
fix/docker
Jun 11, 2019
Merged

[RFR] fix docker setup for dev env#580
nicolasmure merged 2 commits intomasterfrom
fix/docker

Conversation

@nicolasmure
Copy link
Copy Markdown
Contributor

@nicolasmure nicolasmure commented Sep 7, 2018

I was not able to build the images from the current docker setup :

/tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-stream-tls-openssl-bio.c:71:1: error: static declaration of 'BIO_set_init' follows non-static declaration
 BIO_set_init (BIO *b, int init)
 ^~~~~~~~~~~~
In file included from /tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-stream-tls-openssl-bio-private.h:27:0,
                 from /tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-stream-tls-openssl-bio.c:31:
/usr/include/openssl/bio.h:610:7: note: previous declaration of 'BIO_set_init' was here
 void  BIO_set_init(BIO *a, int init);
       ^~~~~~~~~~~~
make: *** [Makefile:503: src/libmongoc/src/mongoc/mongoc-stream-tls-openssl-bio.lo] Error 1
ERROR: `make' failed
ERROR: Service 'php71' failed to build: The command '/bin/sh -c set -xe     && apk add --no-cache --virtual .build-deps         $PHPIZE_DEPS         libssh2-dev         zlib-dev     && docker-php-ext-install         zip     && pecl install         mongodb-${MONGODB_VERSION}         ssh2-${SSH2_VERSION}     && docker-php-ext-enable --ini-name 05-opcache.ini opcache     && docker-php-ext-enable         mongodb         ssh2     && apk del .build-deps' returned a non-zero code: 1

so I rewrote the docker setup for dev env.

The main change with the previous setup is that the dependencies are not installed in the image any more, but directly on the host machine as the whole project is mounted on /app in the container (see the docker-compose.yml file). Doing so, it's easier to look at the source code of vendors with your text editor.

The drawback is that it's not as easy as before to switch from a php version to another (and so to launch the tests on various php versions). There's an instruction in the README which explains how to switch between php versions. But afterall, I'm not sure that it's gonna be a widely encountered use case, and the various php versions are covered by the CI test matrix anyway.

Let me know if you agree.

TODO

  • rebase the fixup commits

@nicolasmure
Copy link
Copy Markdown
Contributor Author

@NiR- I updated this PR for the php7.1 bump. However, the php 7.3 image fails to build as the ssh2 extension is not available for php 7.3 yet.

@nicolasmure nicolasmure merged commit 7507f57 into master Jun 11, 2019
@nicolasmure nicolasmure deleted the fix/docker branch June 11, 2019 09:15
nicolasmure added a commit that referenced this pull request Jun 11, 2019
The tests are using env vars to run. These env vars are storing the
credentials to the different backends.

For the CI, these env vars are set on the project settings (on travis
for instance).

For the development of Gaufrette, and considering the merge of (#580),
the tests should be ran using docker.
The docker setup uses env vars defined in .env files, so we no longer
need to define such vars in the phpunit.xml file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants