Skip to content

Commit b8bb7e4

Browse files
committed
working on docker file sample 2
1 parent 2caf500 commit b8bb7e4

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

docker-2.md

+12
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,29 @@ docker image ls
130130
cd dockerfile-sample-1
131131
132132
vim Dockerfile
133+
Or,
134+
nano Dockerfile
133135
```
134136

135137
## Building Images: Running Docker Builds
138+
139+
* Check the docker sample 1 file.
140+
136141
```
142+
Run: ll (LL small letter)
143+
137144
docker image build -t customnginx .
138145
139146
docker image ls
140147
148+
vim Dockerfi le
149+
Or,
150+
nano Dockerfile
151+
141152
docker image build -t customnginx .
142153
```
143154
## Building Images: Extending Official Images
155+
* Check the docker sample 2 file.
144156
```
145157
cd dockerfile-sample-2
146158

dockerfile-sample-2/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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

dockerfile-sample-2/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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>

0 commit comments

Comments
 (0)