Tag: mysql

having issues while connecting tomcat to mysql in a docker container?

I have 2 docker services created via docker-swarm. One is Tomcat and the other is mysql, i am trying to connect from tomcat to mysql both are in different containers. here is my hibernate.cfg.xml in tomcat container. <property name=”connection.url”> jdbc:mysql://localhost:3306/travelbiz </property> <property name=”connection.username”>trvlbz_admin</property> <property name=”connection.password”>admin123</property> and here is the service running root@ubuntu:/home/smadmin# docker ps CONTAINER […]

Connecting to running docker containers from localhost

I have just installed docker & docker machine on mac os X. I have two running containers I would like to connect to from my terminal: docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5a15af29232f mysql:latest “/entrypoint.sh mysql” 28 minutes ago Up 28 minutes 0.0.0.0:3306->3306/tcp hopeful_fermi 967f240e77d1 elasticsearch “/docker-entrypoint.s” About an hour […]

docker-compose – Can't connect to MySQL database

TL;DR: WordPress cannot connect to MySQL using the below docker-compose config. Error establishing a database connection. Why? I am using the following docker-compose.yml file to set up a LEMP dev environment. docker-compose.yml version: ‘3’ services: nginx: image: nginx ports: – ‘8080:80’ volumes: – ./nginx/config/default.conf:/etc/nginx/conf.d/default.conf – ../wordpress:/var/www/wordpress – ./nginx/log:/var/log/nginx depends_on: – php php: image: php:fpm ports: […]

How can I run an arbitrary MySQL command from within a docker container?

I want a docker container that runs a command for it’s effects, and then it’s fine to stop until I run it again. I just want to run only this, to delete expired rows: mysql –user=$MYSQL_USER –host=$MYSQL_HOST –database=$MYSQL_DB –password=$MYSQL_PASS -se “DELETE FROM sometable WHERE expiration < NOW();” I’ve tried this: FROM ????? ENV MYSQL_USER=$MYSQL_USER ENV […]

Accessing environment variables in Docker containers linked with –link

I’m setting up the development environment for my application inside Docker containers, at the moment I have these containers: myapp-data – Holds application source code and log files myapp-phpfpm – Runs the php5-fpm process for Nginx myapp-nginx – Runs the Nginx web server that serves the application This setup works beautifully, I’m really happy with […]

docker wordpress container can't connect to database container

I’ve been using docker to build wordpress apps for some days. I got some working but now I don’t know why I can get to connect the database container and the wordpress container. I’ve reduced the failing condiguration to the simplest possible. Right now I have the following docker-compose.yml file: wordpress: image: wordpress links: – […]

Persisting a dockerized WordPress (with LAMP stack)

I’m working on moving my WordPress blogs from a traditional setup to Docker, however I’m having some trouble in understanding what is the best way to persist data. In short, my idea is to have each blog running inside its own container (based on tutum/wordpress). During my tests I noticed that if I save any […]

Is using phusion/baseimage still worth it? [closed]

My question is simple: why use phusion/baseimage? I’ve read the site. I’ve been all over it. It’s marketed as better than base, ultraslim built specifically for Docker. With that said: then why aren’t official builds using it by now? phusion/baseimage been out for a while now, but official builds for php, mysql, etc, are still […]

Keep MySQL data inside Docker container

I use Docker and Docker Compose on a project. I hava 3 containers : PHP, MySQL and Nginx. For now, MySQL binary data is stored inside the MySQL container (/var/lib/mysql/…). I think this is not a best practice and may even be dangerous if the container is rebuild from scratch. What is the best way […]

MariaDB never starts within docker image

I’m creating a docker image with ubuntu trusty and MariaDB 5.5 but I can never get MariaDB to start unless I actually connect to the running VM. Dockerfile: FROM ubuntu:trusty # Upgrade packages RUN apt-get update && apt-get upgrade -y # So we can add a repo to apt RUN apt-get install -y software-properties-common # […]

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