Skip to content

Conversation

exussum12
Copy link
Contributor

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

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
@k0kubun
Copy link
Collaborator

k0kubun commented Oct 15, 2018

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.

@k0kubun
Copy link
Collaborator

k0kubun commented Oct 15, 2018

Thank you for your interest to this project anyways!

@exussum12
Copy link
Contributor Author

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"]
Copy link
Collaborator

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?

Copy link
Collaborator

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; \
Copy link
Collaborator

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; \
Copy link
Collaborator

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.

@k0kubun
Copy link
Collaborator

k0kubun commented Oct 16, 2018

The file was something I was using and thought that other developers would find it useful also.

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.

@k0kubun k0kubun merged commit 6bb18b2 into sqldef:master Oct 16, 2018
k0kubun added a commit that referenced this pull request Oct 16, 2018
@exussum12
Copy link
Contributor Author

Looks great. The git requirement can also be removed now. (apk line)

@k0kubun
Copy link
Collaborator

k0kubun commented Oct 16, 2018

I tried the same thing but fetching go dependencies from GitHub seems to require that.

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

Successfully merging this pull request may close these issues.

2 participants