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
Table of contents 1. Common function classificati...
Two small problems, but they bothered me for a lon...
Today I had some free time to write a website for...
There are three ways to start a springboot projec...
1. Introduction to DockerUI DockerUI is based on ...
The effect shows that two browsers simulate each ...
The Golden Rule No matter how many people are wor...
Table of contents 1. Download the MySQL installat...
This article uses an example to describe how to i...
Copy code The code is as follows: <!DOCTYPE ht...
Preface I watched web.dev's 2020 three-day li...
Table of contents Introduction Public code (backe...
1. Introduction to Layer 4 Load Balancing What is...
Preface I believe many students are already famil...
It mainly shows how to configure X-Frame-Options,...