• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Build Docker image using Docker files on Fedora 34

  • 00:30 cat /etc/os-release
  • 00:46 dnf list --installed | grep docker
  • 01:14 mkdir dockerfiles
  • 01:32 vim dockerfiles/dockerfile
  • 03:08 docker build dockerfiles/
  • 03:55 docker images
  • 04:14 docker run 4c078ce14461
{{postValue.id}}

To Build Docker image using Docker files on Fedora 34

Introduction:

Docker images are unchangeable files that contain source code, libraries, dependencies, tools, and other files that are needed to run an application.

Step 1: Check the OS version by using the below command

[root@linuxhelp ~]# cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Step 2: To check the docker installed status by using the below command

[root@linuxhelp ~]# dnf list --installed | grep docker
containerd.io.x86_64                              1.4.12-3.1.fc34                      @docker-ce-stable 
docker-ce.x86_64                                  3:20.10.12-3.fc34                    @docker-ce-stable 
docker-ce-cli.x86_64                              1:20.10.12-3.fc34                    @docker-ce-stable 
docker-ce-rootless-extras.x86_64                  20.10.12-3.fc34                      @docker-ce-stable 
docker-scan-plugin.x86_64                         0.12.0-3.fc34                        @docker-ce-stable 

Step 3: To create directory for the docker file by using the below command

 [root@linuxhelp ~]# mkdir dockerfiles

Step 4: To open the configuration file by using the below command

 [root@linuxhelp ~]# vim dockerfiles/dockerfile
# Getting image from docker hub
FROM httpd

RUN apt-get update

CMD ["echo","Apache web server image"]

Step 5: To run the docker build using the below command

 [root@linuxhelp ~]# docker build dockerfiles/
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM httpd
latest: Pulling from library/httpd
5eb5b503b376: Pull complete 
a43a76ccc967: Pull complete 
942bd346e7f7: Pull complete 
cdb155854ae6: Pull complete 
10c4d45228bf: Pull complete 
Digest: sha256:5cc947a200524a822883dc6ce6456d852d7c5629ab177dfbf7e38c1b4a647705
Status: Downloaded newer image for httpd:latest
 ---> a8ea074f4566
Step 2/3 : RUN apt-get update
 ---> Running in c1de879c6538
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:5 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [116 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [2596 B]
Fetched 8501 kB in 3s (2969 kB/s)
Reading package lists...
Removing intermediate container c1de879c6538
 ---> 5ef582a7ea23
Step 3/3 : CMD ["echo","Apache web server image"]
 ---> Running in 99ffe51c129a
Removing intermediate container 99ffe51c129a
 ---> 4c078ce14461
Successfully built 4c078ce14461

Step 6: To run the docker image command by using the below command

[root@linuxhelp ~]# docker images
REPOSITORY    TAG       IMAGE ID       CREATED          SIZE
<none>        <none>    4c078ce14461   18 seconds ago   161MB
httpd         latest    a8ea074f4566   2 weeks ago      144MB
hello-world   latest    feb5d9fea6a5   4 months ago     13.3kB

Step 7: To check the docker image running status by using the below command

 [root@linuxhelp ~]# docker run 4c078ce14461
Apache web server image

By this to build Docker images using Docker file on Fedora 34 have been completed

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is a Docker Image?

A

A Docker image is an unchangeable file that contains the source code, libraries, dependencies, tools, and other files needed for an application to run.

Q

What is a Docker Container?

A

A Docker container is a virtualized run-time environment where users can isolate applications from the underlying system.
These containers are compact, portable units in which you can start up an application quickly and easily.

Q

Is it possible to create Docker image?

A

Yes, This script is called a Dockerfile.

Q

Which command is used to create a Docker image from a Dockerfile?

A

To create a Docker image from a Dockerfile use the command "docker build".

Q

Does Docker have OS images?

A

Yes, its have OS images.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.