Conversation
btw, I know it is because postgres is not actually running in the container, but I was wondering if there was a way to skip that test just to build |
Hi there, @jfrazelle don't you think it'd be best to keep the postgresql part separate (i.e in a second container) and Cheers. |
Yes but, I cannot do that on build :( Also I put that specifically as a comment in the Dockerfile fyi On Tue, Apr 28, 2015 at 12:44 PM, Martin Simon notifications@github.com
Jessie Frazelle |
True that...
Cheers. |
there is no way with maven to just ignore the test about creating the db? On Tue, Apr 28, 2015 at 1:02 PM, Martin Simon notifications@github.com
Jessie Frazelle |
I'm no java expert (quite the opposite actually, total noob inside 😄 ) but I think you can do something like:
Cheers. |
We can do one of two things: make sure that |
Ah cool so there is no way to skip just that one test I guess because I On Tuesday, April 28, 2015, Alok Menghrajani notifications@github.com
Jessie Frazelle |
@jfrazelle - I have a branch that is able to build successfully by setting up the pg database https://github.com/mbentley/keywhiz/tree/add-dockerfile-hack It is super hackish right now but I'm hoping to get it cleaned up quite a bit to make it not quite so terrible |
Does it require running pg in the container w the tests, so it's a On Friday, May 1, 2015, Matt Bentley notifications@github.com wrote:
Jessie Frazelle |
rm: invalid option -- 'p'
Try 'rm --help' for more information.
INFO[0019] The command [/bin/sh -c apt-get update && apt-get install -y postgresql --no-install-recommends && rm -rf /var/lib/apt/lists/* RUN mkdir -p /usr/src/app] returned a non-zero code: 1 |
@jfrazelle - At build time, yes it runs pg in the background and killing it once it is complete. It should also probably clean up a bit of junk after it does that but I was hacking on it this morning. Totally not ideal, hench the @diogomonica - Sorry, I just rebased and squashed my commits so it is fixed now if you pull. It broke from a missed |
@sul3n3t @alokmenghrajani thoughts? We would love to have a clean solution for people to setup/run keywhiz server quickly. Porting the tests to H2 seems like it removes the major hurdle (having to bundle PG in the container). |
Running everything under H2 by default is nice in many ways but I won't be able to get to it right away. I'm ok merging this PR for now if everyone agrees it's a step forward? |
@alokmenghrajani not yet. @mbentley's Docker file works for building Keywhiz. Right now it doesn't run keywhiz server because it fails to connect to Postgres. |
So I did this and I cringed pretty hard but it is something to start from: Start postgres: Start keywhiz (you need to build this image first): Once in the container, run the following:
|
It looks like 6556985 broke the docker build because failing to connect to the database is an error in the build process 😿 |
it was never working in the first place ;) On Wed, May 20, 2015 at 12:04 PM, David Calavera notifications@github.com
Jessie Frazelle |
it's against my morals to start a db in the build container.... On Wed, May 20, 2015 at 12:04 PM, Jessica Frazelle me@jessfraz.com wrote:
Jessie Frazelle |
master is a little influx between releases. We're trying to make postgres, mysql, and H2 all work. H2 would be the default test DB. It's embedded and in-memory, so that will remove the concern about starting a DB for build/test. |
cool, good to know. I don't mind waiting. |
#92 was merged yesterday and might help you? |
hell ya, let me update ;) |
ADD . /usr/src/app | ||
|
||
# install | ||
RUN mvn install |
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.
don't you want mvn install -P h2
?
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.
updated my b, i am no maven extraordinaire
On Thu, Jun 4, 2015 at 4:15 PM, Alok Menghrajani
notifications@github.com wrote:
In Dockerfile:
+# docker build --rm --force-rm -t square/keywhiz .
+#
+# Example usage:
+# docker run square/keywhiz java -jar
server/target/keywhiz-server-*-SNAPSHOT-shaded.jar server
server/src/main/resources/keywhiz-development.yaml
+#
+FROM maven:3.3-jdk-8
+
+# mkdir for app
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+
+# add the source
+ADD . /usr/src/app
+
+# install
+RUN mvn installdon't you want mvn install -P h2?
—
Reply to this email directly or view it on GitHub.
Jessie Frazelle
4096R / D4C4 DD60 0D66 F65A 8EFC 511E 18F3 685C 0022 BFF3
pgp.mit.edu
Can be useful for testing everything compiles & building. Signed-off-by: Jessica Frazelle <princess@docker.com>
@diogomonica time to merge this? |
you can trust me :D Proof it works:
|
Sounds good, thanks for doing this! I just wanted to make sure we weren't waiting on anything else. |
Can be useful for testing everything compiles & building.
WARNING:
this does not work yet, but I am no jdbc/flyaway expert so idk
I figured I would open and if you want it you can help me fix, but if not just close this no worries :)
I think the problem is, the model pom.xml is trying to create a database then use it.
Failing in the container with:
Let me know if you want the full stack trace. But it's probably just some java thing I don't know.