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
background When working on the blockchain log mod...
I installed redis today and some errors occurred ...
Sysbench is an excellent benchmark tool that can ...
Table of contents Makefile Makefile naming and ru...
Hexadecimal code table of various colors [Part 1] ...
The road ahead is always so difficult and full of...
Preface In the actual use of the database, we oft...
1. Global Object All modules can be called 1) glo...
Achieve results Implementation Code html <div ...
The default number of remote desktop connections ...
MySQL sequence AUTO_INCREMENT detailed explanatio...
This article briefly describes how to use Docker ...
After resetting the system, the MySQL database th...
Now if you want to use the video tag in a page, y...
1.fullpage.js Download address https://github.com...