Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Failure to copy mysql files when running in alpine-linux docker container #141

Open
gloeglm opened this issue Apr 11, 2018 · 5 comments
Open

Comments

@gloeglm
Copy link

gloeglm commented Apr 11, 2018

Our build using wix-embedded-mysql currently fails when attempting to run it in a docker container based on alpine. Apparently the extracted mysql files are not being copied to the target directory:

Failures (6): JUnit Jupiter:FraudCheckControllerIntegrationTest ClassSource [className = '<redacted test class>', filePosition = null] => java.lang.RuntimeException: java.io.IOException: Cannot run program "/<workdir>/target/mysql-5.7-a7da90e3-dadb-4dc9-9aa0-7916c935ff6a/bin/mysqld": error=2, No such file or directory com.wix.mysql.EmbeddedMysql.<init>(EmbeddedMysql.java:51) com.wix.mysql.EmbeddedMysql$Builder.start(EmbeddedMysql.java:155)

The downloaded and extracted files are present however under ~/.embedmysql/extracted/Linux-B64--/MySQL-5.7/mysql-5.7.19-linux-glibc2.12 so that part seems to work fine. There are also no errors visible before the "No such file or directory".

I assume there is some missing regarding the underlying OS, since I can run the build no problem in a docker container based on debian for example, which is not an option for us however.

Is there any way I can get more information why this copying fails, or does anybody know how to resolve this?

@viliusl
Copy link
Collaborator

viliusl commented Apr 26, 2018

I wonder what /<workdir>/ means in this context - I would expect it to be proper absolute path. If there are issues with paths then I would expect extraction/copying to fail before running actual thing.

Interesting experiment would be to check if wix-embedded-mysql build itself works on alpine. Is it hard to for you to check? Also setting logback config to would give more info on what is happening before failure.

@biancaL
Copy link

biancaL commented May 21, 2019

I am experiencing the same issues. Did you find a way to fix this?

@gloeglm
Copy link
Author

gloeglm commented Jul 24, 2019

@biancaL unfortuantely not, I didn't really have time to investigate this, we solved it by switching to a non-alpine based container for our build.

@viliusl the workdir thing is simply me censoring the actual full path

@ConradFinkelstein
Copy link

Same issue for me.

@adandris
Copy link

Installing glibc in your Alpine container solves this particular issue. Just add the following to your Dockerfile:

RUN apk --no-cache add ca-certificates
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
	&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \
	&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-bin-2.29-r0.apk \
	&& apk add glibc-2.29-r0.apk glibc-bin-2.29-r0.apk

However, MySQL is in fact not supported and broken on Alpine, so you should consider migrating to MariaDBj4 instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants