• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial 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
6887

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

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.

Related Tutorials in How to Build Docker image using Docker files on Fedora 34

Related Tutorials in How to Build Docker image using Docker files on Fedora 34

How to Install Docker-CE on RHEL-7.6
How to Install Docker-CE on RHEL-7.6
Sep 11, 2020
How to install TigerVNC Server to Access Remote Desktops
How to install TigerVNC Server to Access Remote Desktops
Apr 27, 2016
How to install Unity Hub on Fedora 34
How to install Unity Hub on Fedora 34
May 14, 2022
How to install Wordpress CMS V4.9.6 on Fedora-28
How to install Wordpress CMS V4.9.6 on Fedora-28
Jun 9, 2018
How to Install Nagios Core by Docker on Ubuntu 21.04
How to Install Nagios Core by Docker on Ubuntu 21.04
Mar 10, 2022
How to Install QT Creator on Fedora 34
How to Install QT Creator on Fedora 34
Jan 18, 2022
How to install GIMP 2.8.22 on Fedora-28
How to install GIMP 2.8.22 on Fedora-28
Jun 13, 2018
How To Install Docker Compose on CentOS 7
How To Install Docker Compose on CentOS 7
Feb 15, 2018

Related Forums in How to Build Docker image using Docker files on Fedora 34

Related Forums in How to Build Docker image using Docker files on Fedora 34

Fedora
jacob class=
Error: Failed to synchronize cache for repo 'updates'
Oct 23, 2021
Fedora
Smith class=
Several Linux distros freeze
Dec 29, 2018

Related News in How to Build Docker image using Docker files on Fedora 34

Related News in How to Build Docker image using Docker files on Fedora 34

Docker friendly Alpine Linux gets hardened Node.js
Docker friendly Alpine Linux gets hardened Node.js
Apr 19, 2017
Fedora 27 is finally available for download
Fedora 27 is finally available for download
Nov 15, 2017
Docker comes to a full circle with DIY Linux
Docker comes to a full circle with DIY Linux
Apr 20, 2017
Docker contains an unpatched rare condition vulnerability
Docker contains an unpatched rare condition vulnerability
Jun 1, 2019
Nearly 20% of the 1000 Most Popular Docker Containers Have No Root Password
Nearly 20% of the 1000 Most Popular Docker Containers Have No Root Password
May 24, 2019
‘Graboid’ - A New Cryptojacking Worm is spread through the Docker hosts
‘Graboid’ - A New Cryptojacking Worm is spread through the Docker hosts
Oct 26, 2019
Microsoft Launches Latest SQL Server Across Windows, Linux, Docker
Microsoft Launches Latest SQL Server Across Windows, Linux, Docker
Sep 28, 2017
32-bit Linux systems with Fedora 31 will no longer be supported
32-bit Linux systems with Fedora 31 will no longer be supported
Oct 14, 2019
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 keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

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.