Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Part-1 Overview of Docker

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Part-1 Overview of Docker


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

What is Docker?

Docker is a platform designed to help developers build, share, and run modern applications.

More simple definition:
Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in same ways you manage your applications. You can ship, test, and deploy code quickly, and significantly reduce delay between writing code and running it in production.

Docker

The whole idea of Docker is for developers to easily develop applications, ship them into containers which can then be deployed anywhere.

What is container?

  1. Docker Containers contain binaries, libraries and configuration files along with the application itself.
  2. Docker Container is a standardised unit which can be created on the fly to deploy a particular application or environment. It could be an Ubuntu container, Debian container, etc. to full-fill the requirement from an operating system point of view.
  3. Docker Containers share resources with other containers in the same host OS and provide OS level process isolation.

Then what are Virtual Machines?

VM

  1. Virtual Machines (VMs) run on Hypervisors, which allow multiple Virtual Machines to run on a single Machine along with its own operating system.
  2. Each VM has its own copy of an operating system along with the application and necessary binaries, which makes it significantly larger and it requires more resources.
  3. They provide Hardware-level process isolation and are slow to boot.

Difference between Docker vs Virtual Machine

Difference

What is a Dockerfile?

  1. It is a text document that contains necessary commands which on execution helps assemble a Docker Image.
  2. Docker image is created using a Docker file.

What is Container Registry?

  1. Docker Hub is the official online repository where you can find other Docker Images that are available for use.
  2. It makes it easy to find, manage and share container images with others.

Dockerhub

Let's create a Docker image using Dockerfile:

Step 1: Make a directory

mkdir test and cd test

Step 2: Now create a file Dockerfile
(File name is hard coded do not change the file name)

touch Dockerfile

Step 3: Create a sample web page with name index.html

Custom docker image created using Dockerfile!!!

Step 4: Edit the Dockerfile using following instructions

FROM centos:7
MAINTAINER Vrukshali
RUN yum install httpd -y
COPY index.html /var/www/html/
CMD [โ€œ/usr/sbin/httpdโ€, โ€œ-Dโ€, โ€œFOREGROUNDโ€]
EXPOSE 80

Dockerfile commands explanation:

MAINTAINER โ€” This command is used to give the information about the author or manager who is managing this image. MAINTAINER Vrukshali

RUN โ€” Before building an image if want some configuration that needs to be present in the image. Inside the image we need to install Apache web server image the command to install that image is RUN yum install httpd -y

COPY - This command is used to copy a file from host os to docker container COPY index.html /var/www/html

EXPOSE - This command is used to specify the port number in which the container is running its process. Anybody can come from outside and connect to this port. Apache webserver is launched at port 80 by default that is why we need to expose container at port 80. EXPOSE 80

CMD - To run a command as soon as container is launched. CMD command is different from RUN because RUN is used at the time of building an image and CMD used to run command when container is started.
/usr/sbin/httpd - This command is used to start the web server
-DFOREGROUNDโ€” This is not a docker command this is http server argument which is used to run webserver in background. If we do not use this argument the server will start and then it will stop.
CMD [โ€œ/usr/sbin/httpdโ€,โ€ -Dโ€,โ€ FOREGROUNDโ€]

Step 5: Build the image using docker build.

docker build -t webserver:v1 .

. is Dockerfile is present n current location and โ€“t option is to tag or name the image.

Output:
last few lines

...
...
Step 6/6 : EXPOSE 80
 ---> Running in ed9972b66ac1
Removing intermediate container ed9972b66ac1
 ---> 5ca87e671dc1
Successfully built 5ca87e671dc1
Successfully tagged webserver:v1

You can now run docker images command.
Output:

REPOSITORY   TAG       IMAGE ID       CREATED              SIZE
webserver    v1        5ca87e671dc1   About a minute ago   392MB
centos       7         eeb6ee3f44bd   4 months ago         204MB

Step 6: Run a container using docker image created by Dockerfile

docker run โ€“dit โ€“p 1234:80 webserver:v1

-p: This argument is used to port forwarding. Which means anybody from outside who comes for 1234 its request is forwarded to port 80. Port 80 is default port number where apache webserver runs.

Step 7: To See the Result :
curl http://<host ip>:1234/ or on webpage http://<host ip>:1234/

Output:

Custom docker image created using Dockerfile!!!

Now we need to push this image to central repository, here I will be using DockerHub as central registry.

Step 1: You need a DockerHub Account
You can create this on https://hub.docker.com/

Step 2: Login to DockerHub via terminal

docker login --username=yourhubusername --email=youremail@company.com

With your own username and email that you used for the account. Enter your password when prompted. If everything worked you will get a message similar to

WARNING: login credentials saved in /home/username/.docker/config.json
Login Succeeded

Step 3: Tag your image

docker tag <image id or image name>:<version> yourhubusername/<image_name>:<version>
docker tag webserver:v1 vrukshali26/web:v1

You can see using docker images

REPOSITORY        TAG       IMAGE ID       CREATED          SIZE
webserver         v1        5ca87e671dc1   14 minutes ago   392MB
vrukshali26/web   v1        5ca87e671dc1   14 minutes ago   392MB
centos            7         eeb6ee3f44bd   4 months ago     204MB

Step 4: Push your image to the DockerHub

docker push yourhubusername/<image_name>:<version>

Output:

The push refers to repository [docker.io/vrukshali26/web]
a59ac102fa99: Pushed 
951641dc1264: Pushed 
174f56854903: Mounted from library/centos 
v1: digest: sha256:29169ceace4c1c0e29022d77453be7dcc97070d9ab1f5bbb640051ff13178f64 size: 948

Now you can see on DockerHub, your first custom docker image has been pushed.

...



๐Ÿ“Œ Part-1 Overview of Docker


๐Ÿ“ˆ 27.74 Punkte

๐Ÿ“Œ Docker users unhappy with latest forced login to download Docker and Docker Store images


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Mehrere Probleme in containerd, docker-runc, go1.11, go1.12, golang-github-docker-libnetwork, go und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Security: Mehrere Probleme in containerd, docker-runc, go1.11, go1.12, golang-github-docker-libnetwork, go und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Mehrere Probleme in containerd, docker-runc, golang-github-docker-libnetwork und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Mangelnde Rechteprรผfung in containerd, docker-runc, golang-github-docker-libnetwork und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Docker Stack Tutorial | Docker Stack Deploy Docker-Compose.yml


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Preisgabe von Informationen in containerd, docker-runc, golang-github-docker-libnetwork und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Preisgabe von Informationen in containerd, docker-runc, golang-github-docker-libnetwork und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Denial of Service in containerd, docker-runc, golang-github-docker-libnetwork und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Preisgabe von Informationen in containerd, docker-runc, golang-github-docker-libnetwork und docker (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Ausfรผhren von Code mit hรถheren Privilegien in docker-runc, golang-github-docker-libnetwork, docker und containerd (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Mehrere Probleme in docker-runc, golang-github-docker-libnetwork, docker und containerd (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Security: Mehrere Probleme in docker-runc, golang-github-docker-libnetwork, docker und containerd (SUSE)


๐Ÿ“ˆ 26.86 Punkte

๐Ÿ“Œ Docker Learning for Beginners Part 5: Create Ubuntu Container Using Dockerfile : Docker build CMD RUN Example


๐Ÿ“ˆ 24.83 Punkte

๐Ÿ“Œ VS Code Docker Extension - Overview


๐Ÿ“ˆ 20.81 Punkte

๐Ÿ“Œ An overview of Docker


๐Ÿ“ˆ 20.81 Punkte

๐Ÿ“Œ Overview of Basic Docker Terminologies


๐Ÿ“ˆ 20.81 Punkte

๐Ÿ“Œ An eBPF overview, part 1: Introduction


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 3: Walking up the software stack


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 3: Walking up the software stack (Collabora blog)


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 4: Working with embedded systems


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 4: Working with embedded systems


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 5: Tracing user processes


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 5: Tracing user processes


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Neural Structured Learning - Part 1: Framework overview


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Part 1: Key Terminology and Overview - Introduction to Reverse Engineering with radare2 Cutter


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ GNOME Shell 40 Port Guide - Part 2 (Overview)


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 5: Tracing user processes (Collabora blog)


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ An eBPF overview, part 5: Tracing user processes (Collabora blog)


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Wireless Pentesting Part 1 โ€“ An Overview


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Data Distribution Service: An Overview Part 1


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Oil and Gas Cybersecurity: Industry Overview Part 1


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Build a Blog Website using Django Rest Frameworkโ€Šโ€”โ€ŠOverview (Part 1)


๐Ÿ“ˆ 18.79 Punkte

๐Ÿ“Œ Securing Your App: TOTP Authentication with Spring Boot and Angular โ€” Part One โ€” Overview & Project Setup


๐Ÿ“ˆ 18.79 Punkte











matomo