#Idea in Docker
dockerized IntelliJ Idea Community Edition
kickstart your dev environment with a sharable workplace inside a docker container
containing the latest IntelliJ Idea Community Edition and Java 8
-
if you have another UID/GID than
1000
please change the Dockerfile and replaceexport uid=1000 gid=1000
with your user / group id inside the Dockerfile. You might run the following script for that task:sed -i "s/export uid=1000 gid=1000/export uid=$UID gid=${GROUPS[0]}/" Dockerfile
You might want to change these values everytime you check out the file from git and revert the replacement before you checkin the changed Dockerfile. Run the following on your host (and adjust the file
.gitattributes
if you change the nameuidfix
) to make that possible:git config filter.uidfix.smudge "sed \"s/export uid=1000 gid=1000/export uid=$UID gid=${GROUPS[0]}/\"" git config filter.uidfix.clean "sed \"s/export uid=$UID gid=${GROUPS[0]}/export uid=1000 gid=1000/\""
-
build the dockerized IntelliJ Idea image:
docker build -t elasticjava/idea:v1 .
-
Idea needs a few configuration steps initially to reduce the popup screens. so first start docker via
docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/usr/local/src --net=host elasticjava/idea:v1
and configure IntelliJ your favourite way, install plugins and define codestyles.
-
quit the running Idea and conserve the last image state as new image without noise:
docker commit $(docker ps -a -f ancestor=elasticjava/idea:v1 -n=1 -q) idea
-
now you can run IntelliJ Idea anywhere inside your favourite source folder with:
docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/usr/local/src --net=host idea