<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://jiagenli.fun</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 03:24:47 GMT</lastBuildDate><atom:link href="https://jiagenli.fun/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Docker 简单使用]]></title><description><![CDATA[Docker Desktop的简单使用，最简单的是用图形化界面统一操控。
Containers 容器，Images 镜像，Volumes 卷(分区)
启动容器：
docker run -d -p 80:80 docker/getting-started

-d - run the container in detached mode (in the background)


-p 80:80 - map port 80 of the host to port 80 in the contain...]]></description><link>https://jiagenli.fun/docker</link><guid isPermaLink="true">https://jiagenli.fun/docker</guid><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Jiagen Li]]></dc:creator><pubDate>Sat, 18 Feb 2023 01:58:31 GMT</pubDate><content:encoded><![CDATA[<p>Docker Desktop的简单使用，最简单的是<strong>用图形化界面统一操控</strong>。</p>
<p>Containers 容器，Images 镜像，Volumes 卷(分区)</p>
<h3 id="heading-5zcv5yqo5a655zmo77ya">启动容器：</h3>
<p>docker run -d -p 80:80 docker/getting-started</p>
<ul>
<li>-d - run the container in detached mode (in the background)</li>
</ul>
<ul>
<li><p>-p 80:80 - map port 80 of the host to port 80 in the container</p>
</li>
<li><p>docker/getting-started - the image to use</p>
</li>
</ul>
<h3 id="heading-build">Build镜像：</h3>
<p>docker build -t getting-started .</p>
<ul>
<li><p>getting-started 镜像名</p>
</li>
<li><p>-t 给镜像起的名字</p>
</li>
<li><p>. 指示Dockerfile所在的位置，. 即当前文件夹</p>
</li>
</ul>
<h3 id="heading-volume">Volume:</h3>
<p>docker volume create todo-db 创建一个名为todo-db，volume的目的是模拟一个公共的磁盘</p>
<p>docker run -dp 3000:3000 -v todo-db:/etc/todos getting-started</p>
<ul>
<li><p>-v 表示这个容器使用volume</p>
</li>
<li><p>todo-db 是volume的名字</p>
</li>
<li><p>/etc/todos 是volume 挂载(mount)的位置</p>
</li>
</ul>
<h3 id="heading-network">Network：</h3>
<p>docker network create todo-app 创建一个名为todo-app的网络</p>
<p>docker run -d <strong>--network todo-app --network-alias mysql</strong> --platform linux/amd64 -v todo-mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=todos mysql:5.7</p>
<ul>
<li>在todo-app的网络空间中创建容器，并指定一个别名 mysql (DNS 查看时会用到)</li>
</ul>
<h3 id="heading-docker-compose">Docker-compose</h3>
<p>由于同一项目使用多个容器并且配置环境变量非常麻烦，使用docker-compose可以将所有配置收敛到一处。</p>
<p>在项目的根目录下增加一个文件docker-compose.yml，内容如下：</p>
<pre><code class="lang-YAML"><span class="hljs-attr">version:</span> <span class="hljs-string">"3.8"</span><span class="hljs-attr">services:</span>
  <span class="hljs-attr">app:</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">node:12-alpine</span>
    <span class="hljs-attr">command:</span> <span class="hljs-string">sh</span> <span class="hljs-string">-c</span> <span class="hljs-string">"yarn install &amp;&amp; yarn run dev"</span>
    <span class="hljs-attr">ports:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-number">3000</span><span class="hljs-string">:3000</span>
    <span class="hljs-attr">working_dir:</span> <span class="hljs-string">/app</span>
    <span class="hljs-attr">volumes:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">./:/app</span>
    <span class="hljs-attr">environment:</span>
      <span class="hljs-attr">MYSQL_HOST:</span> <span class="hljs-string">mysql</span>
      <span class="hljs-attr">MYSQL_USER:</span> <span class="hljs-string">root</span>
      <span class="hljs-attr">MYSQL_PASSWORD:</span> <span class="hljs-string">secret</span>
      <span class="hljs-attr">MYSQL_DB:</span> <span class="hljs-string">todos</span>

  <span class="hljs-attr">mysql:</span>
    <span class="hljs-attr">image:</span> <span class="hljs-string">mysql:5.7</span>
    <span class="hljs-attr">volumes:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">todo-mysql-data:/var/lib/mysql</span>
    <span class="hljs-attr">environment:</span> 
      <span class="hljs-attr">MYSQL_ROOT_PASSWORD:</span> <span class="hljs-string">secret</span>
      <span class="hljs-attr">MYSQL_DATABASE: todosvolumes:</span>
  <span class="hljs-attr">todo-mysql-data:</span>
</code></pre>
<p>docker-compose up -d 使用这个命令启动容器，-d代表着容器后台运行。</p>
<p>docker-compose down --volumes 停止容器，--volumes代表着回收卷。</p>
<h3 id="heading-5bi455so5zg95luk77ya">常用命令：</h3>
<p>docker ps 看运行中的容器</p>
<p>docker stop &lt;the-container-id&gt;</p>
<p>docker rm &lt;the-container-id&gt;</p>
<p>docker exec &lt;container-id&gt; cat /data.txt 执行该容器中的cat命令</p>
]]></content:encoded></item><item><title><![CDATA[关于 IDEA 告警 You have JVM property “https.proxyHost“ set to “127.0.0.1”的解决办法]]></title><description><![CDATA[完整的报错如下图所示：

相信出现这个问题的人都是因为在中国大陆开了代理导致的。
在谷歌搜索解决方案时，很容易搜索到了这个答案，但是我试了之后并没有解决。
我的方法是编辑 IDEA 自定义的 VM Options，在 IDEA 中的 Help - Edit Custom VM Options 添加以下配置：
-Dhttp.proxyHost
-Dhttp.proxyPort
-Dhttps.proxyHost
-Dhttps.proxyPort
-DsocksProxyHost
-DsocksP...]]></description><link>https://jiagenli.fun/idea-you-have-jvm-property-httpsproxyhost-set-to-127001</link><guid isPermaLink="true">https://jiagenli.fun/idea-you-have-jvm-property-httpsproxyhost-set-to-127001</guid><category><![CDATA[IDEs]]></category><dc:creator><![CDATA[Jiagen Li]]></dc:creator><pubDate>Sat, 05 Nov 2022 14:39:31 GMT</pubDate><content:encoded><![CDATA[<p>完整的报错如下图所示：</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667658637242/l3HPWsWSA.png" alt="告警.png" class="image--center mx-auto" /></p>
<p>相信出现这个问题的人都是因为在中国大陆开了代理导致的。</p>
<p>在谷歌搜索解决方案时，很容易搜索到了这个<a target="_blank" href="https://stackoverflow.com/questions/35520337/how-to-remove-jvm-property-https-proxyhost">答案</a>，但是我试了之后并没有解决。</p>
<p>我的方法是编辑 IDEA 自定义的 VM Options，在 IDEA 中的 Help - Edit Custom VM Options 添加以下配置：</p>
<pre><code>-Dhttp.proxyHost
-Dhttp.proxyPort
-Dhttps.proxyHost
-Dhttps.proxyPort
-DsocksProxyHost
-DsocksProxyPort
</code></pre><p>添加之后问题得到了解决。</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1667658454069/pjX4N-TKE.png" alt="解决.png" class="image--center mx-auto" /></p>
]]></content:encoded></item></channel></rss>