I need to install a new linux server on a vps, for using mysql, apache, php and some php appications.
In the future i might need to move this server to an other machine ( for example when i want to move the vps to a machine of my own in collocation).
I understand that with Docker, it is possible to just copy to whole server installation to another machine, without the need to reinstall everything.
But what is the most easy way to do this? What action do i need to when installing the new server? I guess i need to install Linux and the rest in a Docker installation. But i am not sure. Does anyone know a step by step guide?
I am new to Docker. I get overwhelmed with all the tools on How to scale Docker containers in production.
I want to use Plesk as well. Plesk supports Docker. Perhaps is that an easy way to go.
1) Create Dockerfile in which you describe actions that you need to do on image, you can find examples in offical documentation https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
2) Build image from Dockerfile
3) Register on docker hub
4) Push your image to docker hub
5) When you setup new server you just need to pull your image from hub
Related
Yesterday I finished my Drupal and mySQL on Docker backend with NextJS Typescript front end app on my local machine. I have pushed my front end up to the linode server I have running, and it works without any issues using github push and pull. Is it this easy to push and pull docker containers from Docker Hub, or am I doing this all wrong?
I already have docker set up on my linode server. I docker pushed my two containers mySQL and Drupal up to docker hub from my local machine, and then docker pulled them to my linode server. They were pulled as images, so I ran them as containers, and I now have both of these containers running in my linode server. I have no clue if this is transferring all of the data or not, and whether I have to transfer other files over as well to make this work whatsoever.
The problem is, I don't have any clue where to go from here, and I'm pretty sure this isn't at all right. On my localhost I had to have my mySQL container running otherwise my drupal container wouldn't run, but they can both run independently on the server as I have things now.
I also tested just building the mySQL and drupal containers from scratch on the server and they worked the same way as they did on my local machine. I just have no clue how to make them work the same after pulling them from the hub.
Is there a way to link these two pulled containers in the same way and get the drupal container to run on the mySQL container? Or am I completely misunderstanding how all of this stuff works?
Also, I'm not even sure if I have all the files and configs and modules from my local host containers pushed up to the hub. Is pushing and pulling the containers doing this, or am I again completely misunderstanding how this stuff works?
Im now in process of moving running laravel webapp to docker containers and then setting it up in ubuntu server for temporary use. I have access to all files in webapp folder and database. So far i have moved webapp to docker in windows. Wrote dockerfiles for laravel and mysql, docker-compose.yml and also some cronjobs are implemented in dockerfile and seperate script.sh file.
Now i can in windows powershell do docker-compose build and then docker-compose up -d and webapp is working on my local system, i can login acces database data etc.. Everything works same as public webapp.
So part i am struggling a lot is moving those 4 images(laravel,nginx,mysql,redis) to ubuntu server and and running them. i did push and pull images to and from repository. I managed to run on custom port nginx container but it shows blank Welcome to nginx page. So how can i move this project? How i can tell docker on ubuntu to cominucate with other images? Do i need to move also all webapp files? Dosent make sense to me because then whats the point of dockerizing whole project.
If everything is setup correctly, only needed files are containers, docker-compose.yml and config files if those are used in docker-compose.yml.
Hello every one i just want to know is it possible to use my local docker image for containers in redhat openshift online free trial version https://www.openshift.com/trial/ (the one that has test drive over it)? As far as i have searched there are some solutions but that dont seem to work with this openshift online free trial, also i want to know why am i bening asked to enter password again in the profile form when i try to install openshift cli?
Refer to this awesome youtube video, I was able to successfully deploy my local docker image onto the dedicated openshift platform's docker registry with the help of this: Push local docker images to openshift registry - minishift
For deploying from local system you may need to do similar steps, only thing that would be slightly different is that in the video he has a local instance, whereas you would be referring to the online openshift cluster. You would be logging into the docker registry of the online openshift cluster from your local system using the oc cli.
Hope it helps.
I have several questions regarding Docker.
First my project:
I have a blog on a shared host and want to move it to the cloud to have all the server sides in my hands and to have the possibility to scale my server on my needs.
My first intend was to setup a nice ubuntu 14 lts as a server with nginx, php 7 and mysql. But I think it's not that easy to transfer such a server to another cloud i.e. from gce to aws. I then thought about using docker, as a friend told me how easy it is to setup containers and how easy it is to move them from one server to another.
I then read a lot about docker but stumbled upon a few things I wondered about.
In my understanding docker runs just services like php, mysql or similar, but doesn't hold data, right?
Where would I store all the data like database, nginx.conf, php.ini and all the Files I want to serve with nginx (ie. /var/www/)?
Are they stored on the host system? If yes, it would not be easier to move a docker setup then move a whole server, no?
Do I really have an advantage of using Docker to serve a Wordpress Blog or another Website using MySQL and so on?
Thanks in advance
Your data is either stored on the host machine or you data is attached to the docker containers remotely (using a network-attached block device).
When you store your data on the host machine, you have a number of options.
The data can be 'inside' one of your containers (e.g. your mysql databases live inside your mysql container).
You can mount one or more directories from your host machine inside your containers. So then the data lives on your host.
You can create Docker volumes or Docker volume containers that are used to store your data. These volumes or volume containers are mounted inside the container with your application. The data then lives in directories managed by Docker.
For details of these options, see dockervolumes
The last option is that you mount remote storage to your docker containers. Flocker is one of the options you have for this.
At my work I've set up a host (i.e. server) that runs a number of services in docker containers. The data for each of these services 'lives' in a Docker data volume container.
This way, the data and the services are completely separated. That allows me to start, stop, upgrade and delete the containers that are running my services without affecting the data.
I have also made separate Docker containers that are started by cron and these back up the data from the data volume containers.
For mysql, the backup container connects to the mysql container and executes mysqldump remotely.
I can also run the (same) containers that are running my services on my development machine, using the data that I backed up from the production server.
This is useful, for instance, to test upgrading mysql from 5.6 to 5.7.
I need to review the mysql 5.5 server logs but I cannot find a way to get access them via ssh, sftp or mysqlworkbench. The mysql cartridge is in a scaled application. A solution?
There are a couple things here I'd like to point out that should provide some more information on how things work and how to get to the information you're looking for.
Scalable applications with DB's actually have the DB running in a separate gear than the application framework (for scaling purposes). For instance, if you ran rhc app show <appname> --gears for one of your scalable applications you would see that there are 2 gears being used and that the ssh information for each of them is different. So if you're just looking to take a quick look at your logs via ssh, you'll need to ssh into the appropriate gear to get to them.
You will need to use the rhc port-forward command to forward the right local ports to your database gear and then be able to connect mysqlworkbench from there.