-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerLabs Day 2.txt
53 lines (37 loc) · 1.53 KB
/
DockerLabs Day 2.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM creates a layer from the ubuntu:15.04 Docker image.
COPY adds files from your Docker client’s current directory.
RUN builds your application with make.
CMD specifies what command to run within the container.
DockerFile FOr NodeJS
docker build -t <your username>/node-web-app .
docker images
docker run -p 49160:8080 -d <your username>/node-web-app
docker ps
docker logs <container id>
curl -i localhost:49160
Lab 10: Find the Tag of your Images
docker image ls
Lab 11: Pull an image with an specific tag
docker pull nginx:1.11.9 - pulls an nginx image with 1.11.9 version
docker pull nginx:1.11.9-alpine - pulls an nginx image with alpine distribution
docker image ls - Compare the size differences in Alpine and Debian versions
Lab 12: Find the layers of changes made in the image
docker history nginx:latest
docker history mysql
docker image inspect nginx - gives the metadata
You can see the ports you need to Expose,the Environment variables and the default CMD.
it also shows the Archietecture
Lab 13: Image tagging and Pushing to Docker Hub
docker image tag nginx souravlaha/nginx
docker image tag --help
docker image push souravlaha/nginx
docker login
cat .docker/config.json - Stores an Authentication token for Docoker Hub.
docker logout
Lab 14: retag and push
docker image tag souravlaha/nginx souravlaha/nginx:testing
docker image push souravlaha/nginx:testing
Lab 15: Build an image using a DockerFile
docker image build -t customnginx .
Lab 16: MOdify Expose port and rebuild
docker image build -t customnginx . - Notice using cache