File tree 3 files changed +37
-0
lines changed
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -130,17 +130,29 @@ docker image ls
130
130
cd dockerfile-sample-1
131
131
132
132
vim Dockerfile
133
+ Or,
134
+ nano Dockerfile
133
135
```
134
136
135
137
## Building Images: Running Docker Builds
138
+
139
+ * Check the docker sample 1 file.
140
+
136
141
```
142
+ Run: ll (LL small letter)
143
+
137
144
docker image build -t customnginx .
138
145
139
146
docker image ls
140
147
148
+ vim Dockerfi le
149
+ Or,
150
+ nano Dockerfile
151
+
141
152
docker image build -t customnginx .
142
153
```
143
154
## Building Images: Extending Official Images
155
+ * Check the docker sample 2 file.
144
156
```
145
157
cd dockerfile-sample-2
146
158
Original file line number Diff line number Diff line change
1
+ # this shows how we can extend/change an existing official image from Docker Hub
2
+
3
+ FROM nginx:latest
4
+ # highly recommend you always pin versions for anything beyond dev/learn
5
+
6
+ WORKDIR /usr/share/nginx/html
7
+ # change working directory to root of nginx webhost
8
+ # using WORKDIR is preferred to using 'RUN cd /some/path'
9
+
10
+ COPY index.html index.html
11
+
12
+ # I don't have to specify EXPOSE or CMD because they're in my FROM
Original file line number Diff line number Diff line change
1
+ <!Doctype html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+
6
+ < title > This is our 2nd Sample Dockerfile worked and Building Images like Extending Official Images</ title >
7
+
8
+ </ head >
9
+
10
+ < body >
11
+ < h1 > We had just successfully ran a container with a custom file copied into the image at build time!</ h1 >
12
+ </ body >
13
+ </ html >
You can’t perform that action at this time.
0 commit comments