Notification texts go here Contact Us Buy Now!

Menjalankan Nginx Sebagai Container Menggunakan Docker


Tutorial Berikutnya ialah kita akan menjalankan nginx sebagai continer di dalam docker.  Apa itu sih Nginx?

Nginx merupakan server proxy dengan kode sumber terbuka yang juga dapat berfungsi sebagai proxy IMAP/POP3. 

Cek docker yang telah aktif.

$ docker info
$ docker version
$ systemctl show --property ActiveState docker

Perintah di atas berfungsi untuk melihat versi dan informasi dari docker yang kamu gunakan, silahkan pilih salah satu perintah di atas untuk menjalankan perintah.

Pull image docker dari official repository docker.

$ docker image pull nginx:stable

Untuk versi lainnya bisa cek di 

https://hub.docker.com/_/nginx?tab=tags&page=1&ordering=last_updated

Selanjutnya verifikasi image nginx.

$ docker images

Untuk menjalankan nginx di dalam container gunakan perintah berikut.

$ docker container run -itd --name web-server-nginx -p 8080:80 nginx:stable

Lihat continer yang sedang berjalan.

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
15xxxxxxxxxx Nginx 42 seconds ago Up 41 seconds 0.0.0.0:8080->80/tcp web-server-nginx

Sselanjunya cek ngix di dalam browser localhost:8080

Getting Info...

About the Author

IT Enthusiast

Posting Komentar

Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.