-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Use alpine base #21
Use alpine base #21
Conversation
This is excellent @JukieWalsh! Would you be able to add a note to the |
sure, I'll add the commits now |
Might want to take a look at tweaking the makefile to support both parameters too. Unfortunately it won't be very elegant though... |
Thoughts? |
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.
Hey! I have been testing your Dockerfile aginst the latest (dynamodb_local_2018-04-11.tar.gz
)
At the first action I take, I am getting the following error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000000000d7c6, pid=1, tid=0x00007f4499c09ae8
#
# JRE version: OpenJDK Runtime Environment (8.0_191-b12) (build 1.8.0_191-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.191-b12 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 3.10.0
# Distribution: Custom build (Thu Jan 10 09:44:25 UTC 2019)
# Problematic frame:
# C 0x000000000000d7c6
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /opt/dynamodb/hs_err_pid1.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# http://icedtea.classpath.org/bugzilla
#
Did you face the same?
I got the same even forcing the versions described in the issue:
Error:
|
# Use JDK 7. I tried alpine, but all calls to dynamo then fail silently... | ||
# FROM openjdk:7-jre-alpine | ||
FROM openjdk:7 | ||
FROM openjdk:8-jre-alpine |
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 could not make it work locally but it worked using slim
tags
Image sizes:
- regular ~510 mb
- slim ~240 mb
- alpine ~120 mb
Slim will not optimize the image size but it could be already considered an improvement
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 fell off my radar, I'll take a look now and try either getting it to work reliably or else use the slim tags.
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.
Could you give an example of what you ran to get the above error?
I also found this which may explain why: uber/h3-java#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.
👋 @jukie I was getting this kind of message
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.
Let's go for slim
then, still an improvement and I love the build arg so want to get the changes in!
@@ -1,11 +1,12 @@ | |||
# Create the docker images locally. If a BUILD_NUM is provided, we will also | |||
# create an image with the tag BUILD_NUM. | |||
# Specify a specific dynamodb version by changing the DYNAMODB_VERSION=latest build flag as desired |
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 think a trick we can use here is this:
DYNAMODB_VERSION ?= latest
build:
docker build -t dwmkerr/dynamodb:latest --build-arg DYNAMODB_VERSION=$(DYNAMODB_VERSION)
# etc...
This way there's not even any need to change the makefile, the caller can just do:
DYNAMODB_VERSION=1.2.3 make build
Or even:
make build DYNAMODB_VERSION=1.2.3
It's a really nice syntax - if the variable is not specified, the default latest
is use. This is an excellent approach for CI systems - if you have a specific version in mind you can just set it as an env var and the makefile
will just pick it up automatically.
(Nice reference here: https://adamcod.es/2016/11/15/makefile-variables.html)
# Use JDK 7. I tried alpine, but all calls to dynamo then fail silently... | ||
# FROM openjdk:7-jre-alpine | ||
FROM openjdk:7 | ||
FROM openjdk:8-jre-alpine |
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.
Let's go for slim
then, still an improvement and I love the build arg so want to get the changes in!
This is to fix #19
I took what @bradmccormack wrote but made DYNAMODB_VERSION a build arg instead, this way you can support multiple versions in your CI system without modifying the Dockerfile.