Connect to mysql docker on tutum endpoint - mysql

I'm using Tutum to host my application via docker. The first container needed is offical mysql container. I already got it up & running. After that, Tutum provide a service endpointfor me to connect to it:
However, I don't know how to connect to it via the provided endpoint (especially using Sequel Pro). Could anyone help me to figure this out?

As mentioned in "tutum support: Your first service", then endpoint is the url with port exposed by the image.
You would use it as an external client accessing to that url.
Note that you can set a port to be publish statically instead of dynamically (-p x:y instead of -P, in docker run lingo)
But in case of your containerized application, you don't need that endpoint.
Your container, if linked to the mysql container, you will be able to use mysql services from your app container directly.
See "Service discovery and links"
You don't have to use the full endpoint url from your app container.
Note that tutum:
provide a simple way to connect any container on any stack to any other container on your account without having to create service links.
A container can always discover other containers on the same stack using the container name as hostname.

Related

Exposing Docker-MySQL container on Azure to be used as DBaaS

I want to make specifically a docker container that holds standard Docker Hub MySQL image.
Once this container is deployed using Azure Container services, how do I use it remotely?
I want to connect to this (container-hosted) mysql server remotely, so that my APIs can upload data to this database over internet.
Where do I find host,username, password for this hosted MySQL db?
Once this container is deployed using Azure Container services, how do
I use it remotely?
If you deploy the container to Azure Container Service, you can use a service with the LoadBalancer type to expose the port of the container to access outside.
Where do I find host,username, password for this hosted MySQL db?
You can use the environment variables to set the user and password. Except this, you can connect into the container, then go inside the MySQL and create the users manually.

.Net core 3.1 webapi dockerized, error in connection to database MySql (No dockerized)

I have a local project, that is a webapi (.net core 3.1) that connect with MySql (local server), good.
What I want to achieve, is do an image of my webapi (to pass then to production), I can do the image OK. But when I run the image, and I navigate via browser, I get the following error:
Microsoft.EntityFrameworkCore.Database.Connection[2004]
An error ocurred using the connection to database 'nameOfTable' on server 'localhost'
I didn't dockerize the mysql server, it's running as always, on local. I didn't change de user or the password... so I don't understand why I get this error.
Thanks in advance for your help!
When you run a container with your Web API image, the container has its own network and also IP address. If your MySQL instance works your local machine, not on docker-engine, you must have to connect your local to your docker container somehow which is not suggested. Instead of that, you may run a MySQL container that uses your local MySQL data (you can mount a local folder to the container with -v/volumes).

Can containerized windows console app add message to host MSMQ

Containers (Docker,etc) are awesome and I am excited on the possibilities it has to offer. My application uses the following (all installed on windows host machine)
Sql Server
MSMQ
Multiple Console apps end points: to read and write to MSMQ
Website
Now I am planning to containerize the following (windows containers)
Multiple Console apps
Website
I am not looking to containarize MSMQ and SQL Server at the moment and these will be installed on the host machine as before.
I am able to create images and run it as containers using Docker Engine. But they are all running in isolation. They need to interact with the host machine. I am not able to figure that out.
Now after reading lots of articles on the net, I still don't have a valid answer to the following
Can containerized end points (console apps in my case) add messages to HOST MSMQ?
Can containerized console apps end points read messages from HOST MSMQ?
I have read that containerized apps (console in my case) can read and write to SQL server installed on host machine, this is true right?
I am able to create images, run it as containers but these cross linking parts I am not able to figure it out and not getting any conclusive links on the internet, can someone help me out.
Thanks
yes, yes and yes... they can communicate...
The tricky part is to understand that your apps running inside a container in your host are seeing like apps in your host. Which means that if you fire up a service on port 5555 in your container, you can access it by calling localhost:5555 (if 5555 is not taken in the host, otherwise you need to set the -p flag when running the container).
But, when running inside the container... your host is seen as a computer over the network so you need to access it via their common network IP address.
I'm not saying that the only way, that's just the way I know and it works!
Edit: I just happened to find this article you might find useful, not mine. Working with MSMQ in Windows Docker Containers

Mysql in container or different VM

I am running MySQL database on different VM (separate from web server).
Because of separate VM I can protect database by giving access permission to only server and closing all other ports other than 3306.
Now, with docker I can set up LAMP server in one container and MySQL in other. How secure and scalable is this solution?
I am not sure how this type of things work with container services!
protect database by giving access permission to only server and closing all other ports other than 3306.
You can do that with Docker containers. Take a look at Docker Expose.
Not sure what you mean by "scalable" here. See the documentation for scaling containers in general. Usually it's not very difficult.

Create a Docker container with MySQL/MariaDB database

I'm planning to migrate my application stack to Docker. Let me describe the services I'm currently using:
HAProxy, which is used for SSL termination on all service's connections (HTTP and raw TCP connections), and forwards traffic to the services below.
Nginx, which serves static files, like updates and some information pages.
Node.js, which runs the main applications.
MySQL (MariaDB), the database used and shared by all the applications.
My question is about the database.
What's the proper way of running MariaDB in this case?
Install and run it inside my container, along with the other services?
Run the official image in a separate container, and link my container to it with the --link option of Docker's run command?
Does the first option have any disadvantage?
TeamSpeak docker container uses the second option and that's what made me question myself about the correct way of running the database in my case, but I particularly feel more inclined to package all the services inside my own image.
Docker Philosophy: Split your application into microservices and use a container for each microservice.
In your case, I recommend a MariaDB container, Using official (Library) Image gives you easier update management, but feel free to use your custom image.
An HAProxy Container, A nginx container and a nodejs container.
This way you divided your application into microservices, and you can upgrade, manage and troubleshoot them easier in an isolated environment.
If you are thinking about delivering your application to end users via docker, a simple docker-compose file will do the trick for easy launching the required containers.