mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 04:14:38 +00:00
Add more content and fix format
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
### 7.1.1 基本语法
|
||||
|
||||
如下代码块所示,展示了相关示例:
|
||||
|
||||
```docker
|
||||
RUN <command>
|
||||
RUN ["executable", "param1", "param2"]
|
||||
@@ -17,8 +15,6 @@ RUN ["executable", "param1", "param2"]
|
||||
|
||||
#### 1. Shell 格式
|
||||
|
||||
如下代码块所示,展示了相关示例:
|
||||
|
||||
```docker
|
||||
RUN apt-get update
|
||||
```
|
||||
@@ -32,8 +28,6 @@ RUN apt-get update
|
||||
|
||||
#### 2. Exec 格式
|
||||
|
||||
如下代码块所示,展示了相关示例:
|
||||
|
||||
```docker
|
||||
RUN ["apt-get", "update"]
|
||||
```
|
||||
@@ -106,8 +100,6 @@ RUN wget http://url | gzip -d > file
|
||||
|
||||
#### Q:为什么 `RUN cd /app` 不生效?
|
||||
|
||||
如下代码块所示,展示了相关示例:
|
||||
|
||||
```docker
|
||||
RUN cd /app
|
||||
RUN touch hello.txt
|
||||
@@ -122,8 +114,6 @@ RUN touch hello.txt
|
||||
|
||||
#### Q:环境变量不生效?
|
||||
|
||||
如下代码块所示,展示了相关示例:
|
||||
|
||||
```docker
|
||||
RUN export MY_VAR=hello
|
||||
RUN echo $MY_VAR
|
||||
|
||||
Reference in New Issue
Block a user