Sign inSign up

dirichlet/netbeans

By dirichlet

Updated almost 8 years ago

A netbeans container

Image
0

391

dirichlet/netbeans repository overview

Netbeans in a container

All credits goes to Fabio Rehm for his repo for this image.

For the way to run graphical app within docker you should check the post from Jessie Frazelle, along with her dockerfiles repo.

Notes

The --volumes-from maven_data is a trick that works well if you want to store your maven repositories data into a container as well. This is a good way to have a good Java development environment that can be easily thrown away when you don't need it anymore. If you don't need it for now just omit it, but everytime you will build after starting the container, you will have to download all the dependencies again. Check out the maven container and the explanation on the maven data container here.

To run this image do the following:

If you are on Linux
docker run -ti --rm \
    -e DISPLAY=$DISPLAY \
    -v $HOME/dotfiles/.netbeans-docker:/root/.netbeans \
    -v $(pwd):/workspace \
    --volumes-from maven_data \
    --name netbeans \
    dirichlet/netbeans
If you are on Mac

You will need xQuartz installed on your computer. First use socat (got this from the following issue on the docker repository)

socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

Then you can do in another terminal:

docker run -ti --rm \
    -e DISPLAY=192.168.99.1:0 \
    -v $HOME/dotfiles/.netbeans-docker:/root/.netbeans \
    -v $(pwd):/workspace \
    --volumes-from maven_data \
    --name netbeans \
    dirichlet/netbeans

This image will use the current directory as the workspace.

Tips

If you want the plugins to be persisted into the .netbeans-docker folder, you should do the following:

Tools > Plugins > Settings tab

Then in the Advanced section of the Settings tab, select Force install into user directory in the Plugin Install Location selectbox.

To be able to use alt for shortcuts in NetBeans with xQuartz on Mac, I followed this doc from the xQuartz project.

As you can see in my configuration I chose to use the mixed version of the solution : the left alt for shortcups and the right one for special characters (otherwise I wasn't able to do things like {} on my french Keyboard)

Tag summary

Content type

Image

Digest

Size

427.3 MB

Last updated

almost 8 years ago

docker pull dirichlet/netbeans