Running amazonlinux image in docker and install php7.3 into its image

First, grab docker image from docker hubs repository

docker pull amazonlinux

run and get into its bash :

docker run -it --rm amazonlinux /bin/bash

actually you can run have any other flavor as well, such as centos.

Then, once it is running, you can perform any package installation needed. i.e httpd and php7.3 for my case.

yum install httpd
amazon-linux-extras install -y php7.3

Now, time to try commit this image.
get the container id while its running.

C:\Users\user>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
82001296bbdc amazonlinux "bash" 26 minutes ago Up 26 minutes festive_bohr

commit the container as new image:

C:\Users\user>docker commit 82001296bbdc amazonlinux-with-php7.3
sha256:54f6cc3f5f73dcfc656a006f8d7eb96740196cca841ee7544d2349454dcfed69

show list of images:

C:\Users\user>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
amazonlinux-with-php7.3 latest 54f6cc3f5f73 24 seconds ago 531MB
amazonlinux latest 6ef285e58e33 2 months ago 163MB
centos latest 0f3e07c0138f 3 months ago 220MB

Ok, now time to push it out.
login to docker from command line.

C:\Users\user>docker login --username=namran
Password:
Login Succeeded

list of images:

C:\Users\user>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
amazonlinux-with-php7.3 latest 54f6cc3f5f73 2 minutes ago 531MB
amazonlinux latest 6ef285e58e33 2 months ago 163MB
centos latest 0f3e07c0138f 3 months ago 220MB

create docker tags:


C:\Users\user>docker tag 54f6cc3f5f73 namran/amazonlinux-with-php7.3:0.001

Finally, push it out to repository:

C:\Users\user>docker push namran/amazonlinux-with-php7.3
The push refers to repository [docker.io/namran/amazonlinux-with-php7.3]
d07f916bac18: Pushing [=> ] 10.44MB/368.1MB fdf6c4a26006: Mounted from library/amazonlinux

once done, result will be like this.

then you can check at the docker repository, i.e https://hub.docker.com/u/namran

That’s it. pretty simple, right?

Namran Hussin

a soft spoken guy... with exceptional interest in computers and technology. I love to learn new thing and also love to break thing for the sake of learning.. but I do abide to the self-imposed limitation or certain thing such as social thing in life, thing can be done and thing that must be avoided at whatever cost such as drug,illegal tracking, smoke,illicit activity..etc.muahahaha let's share what we had in this short term of the life.! make it worth of the living.~

Leave a Comment
Share
Published by
Namran Hussin

Recent Posts

How you can speak with clarity and influence

Here are five key communication skills that help you speak with clarity and influence: Speak…

7 months ago

? Man360 Academy Q&A Session Video Access – Empower Your Masculine Growth Journey

Are you ready to unlock your full potential as a man?Discover powerful insights, real-life transformations,…

1 year ago

A note to remember

One day we will set aside one whole day to review the whole lesson we…

1 year ago

Dev Fest KL 2024

Last weekend, 07/12/2024 I managed to join Dev Fest Kuala Lumpur 2024, organized by Google…

1 year ago

TIPS BACAAN AL-QURAN

TIPS BACAAN AL-QURANOleh: Dr. Muhd al-Muhaysni.1. Jangan engkau berikan (fokus membaca) al-Quran pada lebihan waktumu…

2 years ago

Selawat 300 ribu kali

Selawat yang ringkas, yang mana apabila kamu membacanya satu kali sebanding 100 ribu kali, jadi…

2 years ago