How to install the latest docker on ubuntu plus a ubuntu lamp container example
Tip: Watch the video full screen and HD.
Support the Channel on Patreon https://www.patreon.com/ribalinux
Docker is an open-source project that automates the deployment of applications inside software containers.
Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.
https://www.docker.com
Commands
Install docker
curl -fsSL https://get.docker.com | sh
Add your user to the docker group so you can use docker without sudo
sudo usermod -aG docker youruser
reboot
lets get a ubuntu image from the docker repository
docker pull ubuntu
Run a shell prompt as root on the container
docker run -i -t ubuntu bash
Update the container package list
apt update
Install apache on the container
apt install apache2
Install mysql on the container
apt install mysql-server mysql-client
Install php on the container
apt install php libapache2-mod-php php-mcrypt php-mysql
Exit the ubuntu container
exit
List all containers on the machine
docker ps -a
Save the container that we installed apache mysql and php as a new image
docker commit id/name yourimagename
Run the LAMP container
docker run -d -p 80:80 lamp /usr/sbin/apache2ctl -D FOREGROUND
List the runing containers on the machine
docker ps
Stop the container
docker stop id/name
Delete the container
docker rm id/name
Run the LAMP container
docker run -d -p 80:80 --restart=always lamp /usr/sbin/apache2ctl -D FOREGROUND
curl -fsSL https://get.docker.com | sh
Add your user to the docker group so you can use docker without sudo
sudo usermod -aG docker youruser
reboot
lets get a ubuntu image from the docker repository
docker pull ubuntu
Run a shell prompt as root on the container
docker run -i -t ubuntu bash
Update the container package list
apt update
Install apache on the container
apt install apache2
Install mysql on the container
apt install mysql-server mysql-client
Install php on the container
apt install php libapache2-mod-php php-mcrypt php-mysql
Exit the ubuntu container
exit
List all containers on the machine
docker ps -a
Save the container that we installed apache mysql and php as a new image
docker commit id/name yourimagename
Run the LAMP container
docker run -d -p 80:80 lamp /usr/sbin/apache2ctl -D FOREGROUND
List the runing containers on the machine
docker ps
Stop the container
docker stop id/name
Delete the container
docker rm id/name
Run the LAMP container
docker run -d -p 80:80 --restart=always lamp /usr/sbin/apache2ctl -D FOREGROUND
PLEASE SUBSCRIBE AND FOLLOW ME ON TWITTER GOOGLE+ OR FACEBOOK!! IF YOU CAN PLEASE SUPPORT THE CHANNEL ON PATREON
Patreon
https://www.patreon.com/ribalinux
Twitter
https://twitter.com/ribalinux
Blogger
http://ribalinux.blogspot.pt/
Facebook
https://www.facebook.com/theribalinux
Google+
https://plus.google.com/u/0/110348492032614636584/posts
Easily deploy an SSD cloud server on @DigitalOcean in 55 seconds. Sign up using my link and receive $10 in credit:https://www.digitalocean.com/?refcode=8f5da5ba306e
Patreon
https://www.patreon.com/ribalinux
https://twitter.com/ribalinux
Blogger
http://ribalinux.blogspot.pt/
https://www.facebook.com/theribalinux
Google+
https://plus.google.com/u/0/110348492032614636584/posts
Easily deploy an SSD cloud server on @DigitalOcean in 55 seconds. Sign up using my link and receive $10 in credit:https://www.digitalocean.com/?refcode=8f5da5ba306e