-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Hub Automated Build #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPEN SOURCE FTW
README.md
Outdated
- [Mariadb/debian](docker/debian-mariadb/) (unfinished) | ||
### Fedora 25 | ||
|
||
Kinda works. [`Dockerfile`](docker/fedora-25/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once #2 is resolved this description should be updated.
README.md
Outdated
|
||
### MariaDB | ||
|
||
Unfinished. [`Dockerfile`](docker/debian-mariadb/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend using WIP or Work In Progress instead.
docker/debian-mariadb/Dockerfile
Outdated
@@ -2,7 +2,7 @@ FROM mariadb:10.1 | |||
|
|||
MAINTAINER Anton Povarov "anton.povarov@gmail.com" | |||
|
|||
COPY build-from-source.sh /opt/ | |||
COPY ./docker/build-from-source.sh /opt/ | |||
COPY 10-pinba-init.sh /docker-entrypoint-initdb.d/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW 10-pinba-init.sh
is missing in the repository, could someone add it, please?
docker/fedora-25/Dockerfile
Outdated
@@ -1,13 +1,15 @@ | |||
FROM fedora:25 | |||
MAINTAINER Anton Povarov "anton.povarov@gmail.com" | |||
|
|||
# TODO: Use multi-stage builds https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using multi-stage Dockerfile
will allow removing cleanup which does not work as expected because of nature of layers :
RUN dnf remove -y git-core gcc gcc-c++ boost-devel cmake autoconf automake libtool mariadb-devel && \
dnf autoremove -y && \
dnf clean all
docker/fedora-25/Dockerfile
Outdated
git clone https://github.com/anton-povarov/pinba2 && \ | ||
git clone https://github.com/anton-povarov/meow && \ | ||
git clone https://github.com/nanomsg/nanomsg ; | ||
git clone --branch master --single-branch --depth 1 https://github.com/anton-povarov/meow && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, https://github.com/anton-povarov/meow/releases has no releases so we have to use master
which is no the best option.
@@ -45,12 +46,14 @@ if [ $1 = "mysqld" ]; then | |||
EOSQL | |||
|
|||
# install plugin and create default db | |||
# TODO: Use --init-file https://mariadb.com/kb/en/library/server-system-variables/#init_file | |||
mysql --protocol=socket -uroot <<-EOSQL | |||
INSTALL PLUGIN pinba SONAME 'libpinba_engine2.so'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--init-file
is designed for his purpose. I will allow storing all related init queries in the dedicated *.sql
file.
docker-compose.yml
Outdated
services: | ||
|
||
fedora-25: | ||
image: anton-povarov/pinba2:fedora-25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will allow you to build & push images with predefined names without providing them every time on command line, for example:
$ docker-compose build fedora-25
Building fedora-25
Step 1/13 : FROM fedora:25
---> 9cffd21a45e3
Step 2/13 : MAINTAINER Anton Povarov "anton.povarov@gmail.com"
---> Using cache
...
$ docker-compose push fedora-25
The push refers to repository [docker.io/anton-povarov/pinba2]
...
BTW I have a question why MariaDB was used and not a Percona? |
Mariadb and not Percona is not a requirement, just something i had easy access to at the time. |
Thing is - as pinba is a plugin - it depends on mysql/mariadb/percona internals that tend to change between versions. |
could you please elaborate on that, hate the cleanup code, will happily use any mechanism to get rid of it. |
@anton-povarov I will update PR to use multi-stage Dockerfile as soon as I will be able to build it successfully. I thing I will have update in next few days on this. |
@anton-povarov I've updated PR, unfortunately, to make Automated Builds work on Docker Hub I had to move FROM fedora:25 as builder
...
FROM fedora:25
...
COPY --from=builder /_src/pinba2/mysql_engine/.libs/libpinba_engine2.so /usr/lib64/mysql/plugin/libpinba_engine2.so
... You can read about it more here: Docker image from this PR is available on Docker Hub: Problem is it still fails with error from #2:
|
Dockerfile
Outdated
FROM fedora:25 | ||
MAINTAINER Anton Povarov "anton.povarov@gmail.com" | ||
|
||
RUN dnf install -y file hostname mariadb-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anton-povarov do you really need file
for production instance? The same question is about hostname
but IMHO it might be just missing dependencies for mariadb-server
.
Dockerfile
Outdated
mariadb-server | ||
|
||
RUN git clone --branch master --single-branch --depth 1 https://github.com/anton-povarov/meow /_src/meow | ||
RUN git clone --branch master --single-branch --depth 1 https://github.com/nanomsg/nanomsg /_src/nanomsg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anton-povarov I would recommend lock nanomsg
to a specific release for example
https://github.com/nanomsg/nanomsg/releases/tag/1.1.5 and download & extract tar.gz using ADD
.
Dockerfile
Outdated
hostname \ | ||
mariadb-server | ||
|
||
RUN git clone --branch master --single-branch --depth 1 https://github.com/anton-povarov/meow /_src/meow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anton-povarov It would be nice to create initial release so we could lock on it and use cur ... | tar ...
as well.
Dockerfile
Outdated
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | ||
EXPOSE 30003 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anton-povarov AFAIK Pinba could listen on TCP/UDP ports for writing and you have to use MySQL port for reading. It would be nice to explicitly set it in Dockerfile.
I found out that Docker Cloud allows to set build context, so it will allow keeping Another option is to use CircleCI for building from multiple base images, but it makes sense only after #2 is fixed. |
Dockerfile
Outdated
FROM fedora:25 | ||
MAINTAINER Anton Povarov "anton.povarov@gmail.com" | ||
|
||
RUN dnf install -y file hostname mariadb-server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anton-povarov / @mkevac maybe it will be better to use official docker image as a base locked on a particular version rather than install latest available mariadb-server
during build runtime, WDYT?
@mkevac please take a look on this PR one more time. Docker Image should be available in 25 minutes here: It's building right now: Locally you can build & start image like this:
P. S.If you can share your Docker Hub username I can add you to collaborators so you can take a look on configuration inside. |
@alexanderilyin it's working great |
@mkevac sweet. I just checked and the image was built automatically:
The only problem that Docker Hub is extremely slow and it took 60+ minutes to build it remotely versus 25 minutes on MBP. |
@mkevac any chances that image could be available here? |
@alexanderilyin we'll try |
unsuccessful in finding owner as of now :( |
@anton-povarov nope, but I've just contacted my friend in Docker. |
RELEASE NOTES
README.md
.docker-compose
for more convenient development ofDockerfiles
.master
.ADDITIONAL INFORMATION
The goal of this change is to clean up existing
Dockerfile
so ready-to-use docker images could be provided by using existing Docker Hub infrastructure. You can see a configured example of Docker Hub repository at https://hub.docker.com/r/alexanderilyin/pinba2/Here are build settings I would recommend: