add docker env#115
Conversation
|
Thanks for the proposal! Where is the source of the Docker file? Maybe we could integrate it directly in this repository, what do you think? |
|
@Hywan Yes, I think so |
Hywan
left a comment
There was a problem hiding this comment.
Thanks for the Dockerfile!
| FROM circleci/php:latest | ||
|
|
||
| RUN git clone https://github.com/wasmerio/php-ext-wasm.git $HOME/project \ | ||
| && cd $HOME/project && git checkout trying && cd $HOME \ |
There was a problem hiding this comment.
It is better to checkout the master branch rather than the trying branch. The latter is used by Bors to run the tests.
There was a problem hiding this comment.
@Hywan Hi, I'm having some problems. When I checkout the master branch, I can't build the docker env(docker build -t phpwasm:0.0.3 .), it prompt error like this:
...
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... unsupported
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
mkdir .libs
gcc -I. -I/home/circleci/project/src -DPHP_ATOM_INC -I/home/circleci/project/src/include -I/home/circleci/project/src/main -I/home/circleci/project/src -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -c /home/circleci/project/src/wasm.cc -fPIC -DPIC -o .libs/wasm.o
cc -shared .libs/wasm.o -L/home/circleci/project/src/. -lwasmer_runtime_c_api -Wl,-rpath -Wl,/home/circleci/project/src/. -Wl,-soname -Wl,wasm.so -o .libs/wasm.so
/usr/bin/ld: cannot find -lwasmer_runtime_c_api
collect2: error: ld returned 1 exit status
...
And I don't know how to resolve it.
There was a problem hiding this comment.
I should use -L instead of -l, but as a short-term solution, did you try to set the LD_LIBRARY_PATH environment variable?
| && sudo make install-modules \ | ||
| && export PATH="$HOME/.cargo/bin:$PATH" \ | ||
| && cd $HOME/project \ | ||
| && composer config repo.packagist composer https://mirrors.aliyun.com/composer/ && composer install --no-progress \ |
There was a problem hiding this comment.
Isn't it a workaround for China? Do we want to keep this in the general Dockerfile?
| (Yes, you need [`just`](https://github.com/casey/just/)). | ||
|
|
||
| ### Docker | ||
| * `docker run -it --rm --name phpwasm1 suhanyujie/phpwasm:0.0.1 bash` |
There was a problem hiding this comment.
Should we update since we have our own Dockerfile file?
|
Thanks for your advice. I'll resolve it. |
|
Thanks :-) |
Solve the issue #113