Skip to content

Commit

Permalink
Merge pull request #3 from imega-docker/issue_#2
Browse files Browse the repository at this point in the history
Issue #2
  • Loading branch information
iMega authored Oct 28, 2016
2 parents 275a8a4 + c33a801 commit 13d3be8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ADD build/rootfs.tar.gz /

EXPOSE 3306

VOLUME ["/var/lib/mysql", "/etc/mysql/conf.d/"]
VOLUME ["/data", "/etc/mysql/conf.d/"]

ENTRYPOINT ["mysqld"]

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:

test:
@docker build -t imega/mysql:test .
@docker run -d --name server_db imega/mysql
@docker run -d --name server_db imega/mysql:test
@docker run --rm=$(DOCKER_RM) \
-v $(CURDIR)/tests:/data \
--link server_db:server \
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This is a simple

## QUICK START
```
$ docker run --rm -v /my/empty/database:/var/lib/mysql -p 3306:3306 imega/mysql
$ docker run -d imega/mysql
```

## TRY NOW
Expand All @@ -42,22 +42,19 @@ Make container with mysql server
```
$ mkdir -p /tmp/empty/db
$ docker run --rm --name "mysqlsrv" -v /tmp/empty/db:/var/lib/mysql imega/mysql
$ docker run --rm --name "mysqlsrv" -v /tmp/empty/db:/data imega/mysql
```
Ok. Make empty folder for data and server up.

Now, you make container with mysql client.

```
$ docker run --rm --link mysqlsrv:mysqlsrv -it gliderlabs/alpine:latest /bin/sh
$ docker run --rm -it --link mysqlsrv:server imega/mysql-client mysql --host=server
```

Ok. You into container.

```
# mysql -h mysqlserver
```
Woooow!

```
Expand Down
Binary file modified build/rootfs.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions runner/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

cp $SRC/my.cnf $ROOTFS/etc/mysql/my.cnf
mkdir -p $ROOTFS/data $ROOTFS/var/lib/mysql $ROOTFS/etc/mysql/conf.d
5 changes: 3 additions & 2 deletions src/my.cnf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[mysqld]
user = root
datadir = /var/lib/mysql
datadir = /data
port = 3306
log-bin = /var/lib/mysql/mysql-bin
log-bin = /data/mysql-bin
socket = /var/lib/mysql/mysql.sock
innodb_use_native_aio = 0
!includedir /etc/mysql/conf.d/

0 comments on commit 13d3be8

Please sign in to comment.