Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

suhanyujie
Copy link

@suhanyujie suhanyujie commented Apr 2, 2020

Solve the issue #113

@Hywan Hywan self-assigned this Apr 27, 2020
@Hywan Hywan added 🎉 enhancement New feature or request 📚 documentation Do you like to read? 📦 component-extension About the PHP extension written in C/C++ labels Apr 27, 2020
@Hywan
Copy link
Contributor

Hywan commented Apr 27, 2020

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 Hywan linked an issue Apr 27, 2020 that may be closed by this pull request
@suhanyujie
Copy link
Author

@Hywan Yes, I think so

Copy link
Contributor

@Hywan Hywan left a 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 \
Copy link
Contributor

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.

Copy link
Author

@suhanyujie suhanyujie May 13, 2020

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.

Copy link
Contributor

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 \
Copy link
Contributor

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`
Copy link
Contributor

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?

@suhanyujie
Copy link
Author

Thanks for your advice. I'll resolve it.

@Hywan
Copy link
Contributor

Hywan commented May 12, 2020

Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 component-extension About the PHP extension written in C/C++ 📚 documentation Do you like to read? 🎉 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

maybe we should have a docker environment
2 participants