-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add docker env #115
base: master
Are you sure you want to change the base?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a workaround for China? Do we want to keep this in the general Dockerfile
?
@@ -165,6 +165,9 @@ please try running `just build-runtime` first. | |||
|
|||
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update since we have our own Dockerfile
file?
Thanks for your advice. I'll resolve it. |
Thanks :-) |
Solve the issue #113