We provide 3 ways of working with JHipster:
npm
npm install -g yo
npm install -g bower
npm install -g gulp
npm install -g generator-jhipster
To find more information, tips and help, please have a look at the Yeoman “getting starting” guide and at the NPM documentation before submitting a bug.
Now that JHipster is installed, your next step is to create an application
The JHipster development box project gives you a virtual machine with all the necessary tools to develop your JHipster project.
It’s an easy way to get up and running very quickly with JHipster.
Besides JHipster, this virtual machine includes many development tools like the Spring Tool Suite, the Atom text editor and MySQL Workbench.
Please go to the JHipster development box page for installation and configuration information.
Please note: this Docker image is for running the JHipster generator inside a container. It’s completely different from the Docker and Docker Compose configurations that JHipster will generate, which goal is to run your generated application inside a container
JHipster has a specific Dockerfile, which provides a Docker image.
It makes a Docker “Automated build” that is available on: https://hub.docker.com/r/jhipster/jhipster/
This image will allow you to run JHipster inside Docker.
This depends on your operating system.
As the generated files are in your shared folder, they will not be deleted if you stop your Docker container. However, if you don’t want Docker to keep downloading all the Maven and NPM dependencies every time you start the container, you should commit its state or mount a volume.
DOCKER_HOST
docker-machine ip default
On Linux, you might need to run the docker command as root user if your user is not part of docker group. It’s a good idea to add your user to docker group so that you can run docker commands as a non-root user. Follow the steps on http://askubuntu.com/a/477554 to do so.
docker
Pull the latest JHipster Docker image:
docker pull jhipster/jhipster
Pull the development JHipster Docker image:
docker pull jhipster/jhipster:master
You can see all tags here
Create a “jhipster” folder in your home directory:
mkdir ~/jhipster
Run the Docker image, with the following options:
docker run --name jhipster -v ~/jhipster:/home/jhipster/app -v ~/.m2:/home/jhipster/.m2 -p 8080:8080 -p 3000:3000 -p 3001:3001 -d -t jhipster/jhipster
To check that your container is running, use the command docker ps:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4ae16c0539a3 jhipster/jhipster "tail -f /home/jhipst" 4 seconds ago Up 3 seconds 0.0.0.0:3000-3001->3000-3001/tcp, 0.0.0.0:8080->8080/tcp jhipster
docker stop jhipster
docker start jhipster
In case you update the Docker image (rebuild or pull from the Docker hub), it’s better to remove the existing container, and run the container all over again. To do so, first stop the container, remove it and then run it again:
docker rm jhipster
The easiest way to log into container is by executing following command:
docker exec -it <container_name> bash
If you copy-pasted command to run container from above, notice the name being specified as jhipster
docker exec -it jhipster bash
You will login as “jhipster” user. In case you need to do a sudo, password for the user is the same as the username (jhipster).
sudo
jhipster
You can then go to the /home/jhipster/app directory in your container, and start building your app inside Docker:
cd /home/jhipster/app
yo jhipster
Once your application is created, you can run all the normal gulp/bower/maven commands, for example:
./mvnw
Congratulations! You’ve launched your JHipster app inside Docker!
On your host machine, you should be able to :
http://DOCKER_HOST:8080