Tag: mysql

How to create mysql volume which exists even if i remove the docker container

I created docker container with mysql using -v option: -v /storage/mysql1/mysql-datadir:/var/lib/mysql When i removed container i lost database saved in /var/lib/mysql . How can i create mysql container with -v option (to see everything from the host) and not lost the data?

Best way to use mysql for docker based microservices

I am developing microservices stack using spring cloud and database is mysql. for easily explain lets take one service and one mysql database. my questions what is the best way to deploy mysql database to production for container based enviorment. I can use mysql docker and mount host local file system to docker using -v […]

How to commit changed data in a mysql container to a new image

I am trying to create a custom docker image with mysql database in it. I don’t need to mount volumes or persist any data between container runs and removals. The goal is to always start containers in the same state. Use them for tests and remove them. Steps taken: Start a mariadb container from a […]

Accessing a MySql database from external IP (Docker containers)

Using Docker containers, I am trying to access a MySQL Docker container (https://hub.docker.com/_/mysql/) from other containers. To do that, I’ve been using the PhpMyAdmin docker container (https://hub.docker.com/r/phpmyadmin/phpmyadmin/) which is the most simple way to view mysql databases. Access denied However… my phpmyadmin container cannot connect to the mysql container, giving the following error : #1045 […]

Installing PDO driver in Docker

I’m trying to install pdo driver in docker. How do I install it using the below configuration? docker-compose.yml web: image: nginx:latest ports: – “8089:80” volumes: – ./code:/code – ./site.conf:/etc/nginx/conf.d/site.conf links: – php php: image: php:7-fpm volumes: – ./code:/code mysql: image: mysql:5.6.26 environment: – MYSQL_ROOT_PASSWORD=root – MYSQL_DATABASE=bignibou ports: – “3306:3306” I also have a Dockerfile which […]

Docker – secure mysql configuration

I want to make a separate docker container for mine mysql database which will run for my production and test environment. The problem is that it has the potential to exposes the port number and environment values to for example hackers who have gained access to the container. How can I write a secure mysql […]

Deploying Docker containers with port-mapping on Mesos/Marathon

I am currently working on a team project utilizing Docker with Apache Mesos/Marathon. To deploy MySQL docker containers on Mesos/Marathon, we have to create a JSON file with port mapping. I have searched everywhere on the internet and just can’t find any sample JSON file to look on for port mapping. Anyone have done this […]

MySQL Setup using Docker

I’m trying to create a setup where when I do a “docker run” off a Dockerfile that I’ve created, docker will install and setup mysql, and then create a database for me to use. Below is my simple docker file that pulls from the existing dockerfile/mysql FROM dockerfile/mysql COPY dbsetup.sql /tmp/dbsetup.sql RUN bash -c “/usr/bin/mysqld_safe […]

Cannot delete files on docker host

I’m using the following shell script to extract my databases in the entrypoint and startup the container. #!/bin/bash if [ ! -d “/var/lib/mysql/assetmanager” ]; then tar -zxvf mysql.tar.gz fi exec /usr/bin/mysqld_safe On startup I mount a local directory to the /var/lib/mysql directory with the -v parameter and extract then the files with the above script. […]

How to access a mysql database that is into a Docker continer?

I’m working in a windows environment and I have my MySQL database into a Docker container, but how I should access from an external application? Right now I’m just want to use a regular Java Class to test the connection but what address should I use? I’ve tried with the boot2docker ip, but that doesn’t […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.