Skip to content

Commit

Permalink
use mlat-client as build image (#314)
Browse files Browse the repository at this point in the history
* use mlat-client as build image

don't uninstall build infrastructure

* add stop_service function

---------

Co-authored-by: kx1t <[email protected]>
  • Loading branch information
wiedehopf and kx1t authored Aug 6, 2024
1 parent dc8a0ff commit 1b94c21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile.mlatclient
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ RUN \
mlatclient_target="$(which mlat-client)" && \
tar zcvf /mlatclient.tgz "${dist_pkg_target}" "${mlatclient_target}" && \
#
# Clean up to keep the build image small:
apt-get remove -y "${PACKAGES[@]}" && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
# Don't remove any packets, this image is meant to be used as a build image
#apt-get remove -y "${PACKAGES[@]}" && \
#apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean && \
rm -rf /src/* "${dist_pkg_target}" "${mlatclient_target}" && \
bash /app/scripts/clean-build.sh
10 changes: 10 additions & 0 deletions scripts/common
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ SCRIPT_NAME="${SCRIPT_NAME%.*}"

# shellcheck disable=SC2034
s6wrap=(s6wrap --quiet --timestamps --prepend="$SCRIPT_NAME" --args)

# this stops the s6 service thus eliminating to have sleep running for services that shouldn't run
# meant to be used in the script that is the child to s6-supervise
function stop_service() {
_SERVICE=$(ps -q$(ps -cp $$ -o ppid="") -o args= | grep -F s6-supervise | cut -d' ' -f2)
s6-svc -d /run/service/"${_SERVICE}"
# just in case this doesn't work, exec an infinite sleep
# if the service stopping works, the sleep will just be terminated
exec sleep infinity
}

0 comments on commit 1b94c21

Please sign in to comment.