The local environment is Windows 10 + WSL2 (Ubuntu). You need to install Docker on the server and enable remote access. # Enable remote access -H tcp://0.0.0.0:2375 # Enable local socket access -H unix:///var/run/docker.sock DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock" After installing the Docker plug-in in Idea, set the address tcp://192.168.50.28:2375 (your local IP address). If the connection is successful, there will be a Connection Successful prompt To configure the Tools option, you need to install the Windows version of Docker first. After the installation, close the program and turn it off automatically when the computer starts, because I don’t want to open an extra program. Ubuntu already has Docker, so here I just need to use docker-compose.exe to do container orchestration in the Windows environment. Don't worry about Docker Machine if you don't need it. General Dockerfile and docker-compose.yml file reference FROM ubuntu:latest COPY target/*.jar /app.jar ENV JAVA_HOME="/usr/lib/jdk1.8" ENV PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/sbin" ENTRYPOINT [ "java", "-jar", "/app.jar" ] version: '3' services: last: build: context: . dockerfile: Dockerfile ports: - "18080:8080" volumes: - /usr/lib/jvm/java-8-openjdk-amd64:/usr/lib/jdk1.8 #Host jdk maps to container using tty: true network_mode: bridge restart: always Creating Docker containers using Docker-compose Compose files Select the docker-compose.yml file you just created run
This is the end of this article about deploying Docker to WSL2 with IDEA. For more information about deploying Docker to WSL2 with IDEA, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: A comparison between the href attribute and onclick event of the a tag
>>: MySQL quickly inserts 100 million test data
1. Avoid declaring the page as XML type . The pag...
Create a container [root@server1 ~]# docker run -...
As the most commonly used layout element, DIV play...
Preface This article mainly introduces the method...
MySQL password is correct but cannot log in local...
Preface What is data type conversion? The default...
Table of contents 1. Background 2. Slow query cau...
Effect Fading from top to bottom Source code html...
Here is an example code for using regular express...
The use of computed in vue3. Since vue3 is compat...
Table of contents K8S Advanced Features Advanced ...
Table of contents Why use day.js Moment.js Day.js...
Table of contents 1: Prepare https certificate 2:...
Table of contents Creating Arrays in JavaScript U...
CSS Operations CSS $("").css(name|pro|[...