-
-
Notifications
You must be signed in to change notification settings - Fork 194
Create Dockerfile #16
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
Conversation
build with docker build -t sqldef . then run with docker run -i sqdef to run mysql version docker run -i sqdef ./psqldef to run psql version
I don't have any reason to reject this, but I don't think of any motivation to support this either. Could you describe why committing your Dockerfile to this repository is beneficial for you? Why not maintain Dockerfile on your own repository or somewhere else which you can easily handle? At least I would use sqldef in binary release form and so the Dockerfile wouldn't be actively maintained by me even if it were committed to this upstream. |
Thank you for your interest to this project anyways! |
The use case is stateless build machines. This means either wget'ing the binary (knowing the arch) or just building. Im trying to use this tool as part of a database build / maintenance script, ie checked in database structures and using git to apply the correct files. The Dockerfile makes the building simple and consistent across architectures. The file was something I was using and thought that other developers would find it useful also. Ideally it would be pushed to dockerhub but it does work without that also. |
make all; | ||
|
||
WORKDIR "/go/sqldef/build/linux-amd64" | ||
CMD ["/go/sqldef/build/linux-amd64/mysqldef"] |
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.
sqldef is not meant to be MySQL-specific. Could you remove this line so that mysqldef and psqldef can be used in a symmetric way?
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.
docker run -i sqdef ./psqldef
I think you can update PATH or move binaries to a directory under PATH to remove ./
.
@@ -0,0 +1,10 @@ | |||
FROM golang:1.11.1-alpine3.8 | |||
run apk add --no-cache build-base make gcc git; \ | |||
git clone https://github.com/k0kubun/sqldef.git; \ |
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.
There seems to be no way to invalidate Docker build cache. If you really want to manage your Dockerfile in this repository, use COPY
of the root directory of this repository so that docker build
after editing files would work correctly.
@@ -0,0 +1,10 @@ | |||
FROM golang:1.11.1-alpine3.8 | |||
run apk add --no-cache build-base make gcc git; \ |
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.
Run this separately from COPY
commented above.
Your opinion makes sense, but actually I feel your Dockerfile is designed for your own internal use and not a suitable thing to be committed to this repository. Anyway, I'll merge your work and fix commented parts so that your goal "other developers would find it useful" is met. |
Looks great. The git requirement can also be removed now. (apk line) |
I tried the same thing but fetching go dependencies from GitHub seems to require that. |
build with
docker build -t sqldef .
then run with
docker run -i sqdef to run mysql version
docker run -i sqdef ./psqldef
to run psql version