Skip to content

add docker env#115

Open
suhanyujie wants to merge 2 commits into
wasmerio:masterfrom
suhanyujie:modifyReadmeForDockerEnv
Open

add docker env#115
suhanyujie wants to merge 2 commits into
wasmerio:masterfrom
suhanyujie:modifyReadmeForDockerEnv

Conversation

@suhanyujie
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
Author

@Hywan Yes, I think so

Copy link
Copy Markdown
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!

Comment thread 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

Comment thread Dockerfile
&& 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
Copy Markdown
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?

Comment thread README.md
(Yes, you need [`just`](https://github.com/casey/just/)).

### Docker
* `docker run -it --rm --name phpwasm1 suhanyujie/phpwasm:0.0.1 bash`
Copy link
Copy Markdown
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
Copy Markdown
Author

Thanks for your advice. I'll resolve it.

@Hywan
Copy link
Copy Markdown
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