Bring back tini-static! 🎉

This allows the use of `tini` within even more minimal environments (such as images that are `FROM scratch` with a single application binary `COPY`'d in).
pull/4/head
Tianon Gravi 10 years ago committed by Thomas Orozco
parent 1656d47301
commit f2229f937e
  1. 4
      CMakeLists.txt
  2. 11
      README.md
  3. 29
      ci/run_build.sh
  4. 2
      test/test.py
  5. 11
      tpl/README.md.in
  6. 1
      tpl/travis.yml.tpl

@ -36,8 +36,12 @@ include_directories ("${PROJECT_BINARY_DIR}")
add_executable (tini src/tini.c) add_executable (tini src/tini.c)
add_executable (tini-static src/tini.c)
set_target_properties (tini-static PROPERTIES LINK_FLAGS "-Wl,--no-export-dynamic -static")
# Installation # Installation
install (TARGETS tini DESTINATION bin) install (TARGETS tini DESTINATION bin)
install (TARGETS tini-static DESTINATION bin)
# Packaging # Packaging
include (InstallRequiredSystemLibraries) include (InstallRequiredSystemLibraries)

@ -63,11 +63,22 @@ Assuming your entrypoint was `/docker-entrypoint.sh`, then you would use:
ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"] ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"]
### Statically-Linked Version ###
Tini has very few dependencies (it only depends on libc), but if your
container fails to start, you might want to consider using the statically-built
version instead:
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
### Size Considerations ### ### Size Considerations ###
Tini is a very small file (in the 10KB range), so it doesn't add much weight Tini is a very small file (in the 10KB range), so it doesn't add much weight
to your container. to your container.
The statically-linked version is bigger, but still < 1M.
### Building Tini ### ### Building Tini ###

@ -22,26 +22,27 @@ make package
popd popd
# Smoke tests (actual tests need Docker to run; they don't run within the CI environment) # Smoke tests (actual tests need Docker to run; they don't run within the CI environment)
tini="${BUILD_DIR}/tini" for tini in "${BUILD_DIR}/tini" "${BUILD_DIR}/tini-static"; do
echo "Testing $tini with: true" echo "Testing $tini with: true"
$tini -vvvv true $tini -vvvv true
echo "Testing $tini with: false" echo "Testing $tini with: false"
if $tini -vvvv false; then if $tini -vvvv false; then
exit 1 exit 1
fi fi
# Place files # Move files to the dist dir for testing
mkdir -p "${DIST_DIR}" mkdir -p "${DIST_DIR}"
cp "${BUILD_DIR}"/tini{,*.rpm,*deb} "${DIST_DIR}" cp "${BUILD_DIR}"/tini{,-static,*.rpm,*deb} "${DIST_DIR}"
# Quick audit # Quick audit
if which rpm; then if which rpm; then
echo "Contents for RPM:" echo "Contents for RPM:"
rpm -qlp "${DIST_DIR}/tini"*.rpm rpm -qlp "${DIST_DIR}/tini"*.rpm
fi fi
if which dpkg; then if which dpkg; then
echo "Contents for DEB:" echo "Contents for DEB:"
dpkg --contents "${DIST_DIR}/tini"*deb dpkg --contents "${DIST_DIR}/tini"*deb
fi fi
done

@ -73,7 +73,7 @@ if __name__ == "__main__":
# Funtional tests # Funtional tests
for entrypoint in ["/tini/dist/tini"]: for entrypoint in ["/tini/dist/tini", "/tini/dist/tini-static"]:
functional_base_cmd = base_cmd + [ functional_base_cmd = base_cmd + [
"--entrypoint={0}".format(entrypoint), "--entrypoint={0}".format(entrypoint),
img, img,

@ -63,11 +63,22 @@ Assuming your entrypoint was `/docker-entrypoint.sh`, then you would use:
ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"] ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"]
### Statically-Linked Version ###
Tini has very few dependencies (it only depends on libc), but if your
container fails to start, you might want to consider using the statically-built
version instead:
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
### Size Considerations ### ### Size Considerations ###
Tini is a very small file (in the 10KB range), so it doesn't add much weight Tini is a very small file (in the 10KB range), so it doesn't add much weight
to your container. to your container.
The statically-linked version is bigger, but still < 1M.
### Building Tini ### ### Building Tini ###

@ -29,6 +29,7 @@ deploy:
secure: Yk90ANpSPv1iJy8QDXCPwfaSmEr/WIJ3bzhQ6X8JvZjfrwTosbh0HrUzQyeac3nyvNwj7YJRssolOFc21IBKPpCFTZqYxSkuLPU6ysG4HGHgN6YJhOMm4mG4KKJ6741q3DJendhZpalBhCEi+NcZK/PCSD97Vl4OqRjBUged0fs= secure: Yk90ANpSPv1iJy8QDXCPwfaSmEr/WIJ3bzhQ6X8JvZjfrwTosbh0HrUzQyeac3nyvNwj7YJRssolOFc21IBKPpCFTZqYxSkuLPU6ysG4HGHgN6YJhOMm4mG4KKJ6741q3DJendhZpalBhCEi+NcZK/PCSD97Vl4OqRjBUged0fs=
file: file:
- "./dist/tini" - "./dist/tini"
- "./dist/tini-static"
- "./dist/tini_@tini_VERSION_MAJOR@.@tini_VERSION_MINOR@.@tini_VERSION_PATCH@.deb" - "./dist/tini_@tini_VERSION_MAJOR@.@tini_VERSION_MINOR@.@tini_VERSION_PATCH@.deb"
- "./dist/tini_@tini_VERSION_MAJOR@.@tini_VERSION_MINOR@.@tini_VERSION_PATCH@.rpm" - "./dist/tini_@tini_VERSION_MAJOR@.@tini_VERSION_MINOR@.@tini_VERSION_PATCH@.rpm"
on: on:

Loading…
Cancel
Save