Skip to content

Commit

Permalink
Update docker
Browse files Browse the repository at this point in the history
  • Loading branch information
onlineTrainingguy authored Jun 29, 2020
1 parent ff66e11 commit 712fbd9
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions DockerCommands/docker
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
Docker:-Container

apt-get update
apt-get install docker.io
Installation Steps on Ubuntu
1 apt update
2 apt install docker.io -y
3 docker --version
4 docker info
5 systemctl status docker

Installation Steps on Centos
1 yum update -y
2 yum install -y yum-utils
3 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4 yum install docker-ce docker-ce-cli containerd.io
5 systemctl status docker
6 systemctl start docker
7 systemctl status docker
8 docker --version
9 docker info
10 docker version

docker --version
docker version
docker info
Expand All @@ -21,7 +38,9 @@ docker hub--->docker engine-->Docker images---> run,stop,deleted
docker kill <<container id>> to stop or kill forcefully
docker rm <<container id>> to remove the container
docker exec -it d9a77afafa3b bash

docker run -it --name test ubuntu
create a user using adduser
docker exec -it -u raman test bash
docker rmi 47b19964fb50 //remove the images


Expand Down Expand Up @@ -96,6 +115,17 @@ ADD . /var/www/html
ENTRYPOINT apachectl -D FOREGROUND
ENV name DEVOPS


# Base image is CentOS 7
FROM centos:7
# Add a new user "john" with user id 8877
RUN useradd -u 8877 raman
# Change to non-root privilege
USER raman

sudo docker build -t nonrootimage . # create custom image
docker exec -it test2 bash

Create an html file in the current directory.(index.html)
Build the docker file
docker build . -t new_dockerfile
Expand Down

0 comments on commit 712fbd9

Please sign in to comment.