简体   繁体   中英

How to access a directory in docker container from host machine?

I have a docker wildFly container running on 127.0.0.1:8089 in my host. I would like to make this as my default application server for testng/arquilian test.

Earlier : -DWILDFLY_HOME=/Users/abdulrazak/dev/wildfly/devsetup/wildfly-8.1.0.Final

I was using wildfly instance on my local as a default and I would to change this to docker wildlfy instance.

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
70eb157707ac        my_test_wildfly     "container-entrypo..."   26 minutes ago      Up 28 minutes       9990/tcp, 0.0.0.0:8090->8080/tcp   vibrant_cori

How can I point wildFly directory on docker container as my WILDFLY_HOME path ?

From what I understand, you want to make the wildfly home on your machine accessible by the container. For that you can bind your wildfly directory on your host onto the container.

docker run -v <path-to-folder-on-host>:<path-in-container> ...

This will mount the folder on the machine onto the container at the specified location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM