-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add tini to allow termination signal handling #4217
base: main
Are you sure you want to change the base?
Add tini to allow termination signal handling #4217
Conversation
Signed-off-by: chawinphat <[email protected]>
Signed-off-by: chawinphat <[email protected]>
Signed-off-by: chawinphat <[email protected]>
@@ -123,6 +123,5 @@ else | |||
fi | |||
|
|||
# Docker build | |||
docker build --build-arg VERSION=$VERSION --build-arg BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` --build-arg NOTES=$NOTES -f $DOCKERFILE $DIR -t opensearchproject/$PRODUCT:$VERSION | |||
docker tag opensearchproject/$PRODUCT:$VERSION opensearchproject/$PRODUCT:latest | |||
docker build --build-arg VERSION=$VERSION --build-arg BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` --build-arg NOTES=$NOTES -f $DOCKERFILE $DIR -t opensearchproject/$PRODUCT:$VERSION --build-arg TARGETARCH=${arch_uname} |
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.
Are you using the multi-arch script to test?
The problem with adding a targetarch approach is that you can only do so for a single arch, not multi.
Consider similar to this approach here:
RUN tar -xzpf $TEMP_DIR/opensearch-dashboards-`uname -p`.tgz -C $OPENSEARCH_DASHBOARDS_HOME --strip-components=1 && \ |
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.
And why is the tag step being removed?
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.
uname -m
might be better tho at the time I use -p
with similar effect.
Tho historically -m should be more portable than -p.
And we have used -m for all other purposes already.
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 accidentally removed the tag step line. Will add it back.
I have been building using the multi-arch script and its been working.
./build-image-multi-arch.sh -v 1.0.0 -f ./dockerfiles/opensearch.al2.dockerfile -p opensearch -a "x64,arm64" -r "<Docker Hub RepoName>/<Docker Image Name>:<Tag Name>"
and then running using:
$ docker run -it -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:1.1.0
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 changed to using 'uname -m' now. Tested with single arch and multi arch and both are able to gracefully terminate.
Signed-off-by: chawinphat <[email protected]>
Signed-off-by: chawinphat <[email protected]>
Signed-off-by: chawinphat <[email protected]>
Put it to pending now as it might be able to solve just by using Thanks. |
Description
Adds tini as the PID1 process in opensearch and opensearch-dashboards container to allow for termination signal handling.
Tini couldn't be found when using './tini' as the install path, so I reverted to using 'bin/tini'.
Issues Resolved
closes [BUG] OpenSearch container does not allow for graceful termination #3229
Test Plan and Results:
docker run -it -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" chawinphat/opensearch:1.3.9
I was able to pass this test process on both single and multi arch builds.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.