Mount container folder on host

0

Good Afternoon personal, I would like an orientation in creating an image and composite. I'm preparing an environment for the java development team with eclipse toncat java and initial workspace.

I thought about starting with an image of ubuntu. I would like to leave by default a structure inside / usr / local / java in the image until then okay, but I have the workspace that I can not leave in the image because it would not allow recording in it. What would be the correct practice to adopt for this workspace? Can I make a compose file to do the first checkout on the host machine?

Currently I have the image with all the Workspace inside and I'm trying to see the files of the contaminate on the host but I can not ... just the opposite.

commands I've already used:

docker run -d -it  --name eclipseDocker2  --mount type=bind,source="/Users/michel.teixeira/eclipseDocker/",target=/usr/local/java/ eclipse_beta4
    
asked by anonymous 26.03.2018 / 22:03

1 answer

0

I do not think I understand very well.

Do you need to have your container check out a host directory on which your container is running? This can be done when your container starts (defined in an ENTRYPOINT). Since you have already defined a volume, whatever the container saves on this volume you will be able to access through the host. For example, imagine that I started my container in the following way:         docker run -v / home / user / workspace: / app / workspace ubuntu: latest

When your container initializes and the checkout command you set in your Dockerfile's ENTRYPOINT write to the% container directory, any other process running on the host will be able to access these files going to the /app/workspace directory of the host.

    
30.04.2018 / 15:31