Skip to content

Commit 2c02e14

Browse files
authored
Merge pull request #73 from krallin/32bits
Build i386 binary
2 parents b837c03 + 41cc6b3 commit 2c02e14

9 files changed

Lines changed: 66 additions & 32 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
- CC=gcc ARCH_SUFFIX=amd64 ARCH_NATIVE=1 MINIMAL=
99
- CC=arm-linux-gnueabihf-gcc ARCH_SUFFIX=armhf ARCH_NATIVE= MINIMAL=
1010
- CC=aarch64-linux-gnu-gcc ARCH_SUFFIX=arm64 ARCH_NATIVE= MINIMAL=
11+
- CFLAGS="-m32" ARCH_SUFFIX=i386 ARCH_NATIVE= MINIMAL=
1112
- CC=gcc ARCH_SUFFIX=amd64 ARCH_NATIVE=1 MINIMAL=1
1213
global:
1314
- SIGN_BINARIES=1

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ project (tini C)
33

44
# Config
55
set (tini_VERSION_MAJOR 0)
6-
set (tini_VERSION_MINOR 13)
7-
set (tini_VERSION_PATCH 2)
6+
set (tini_VERSION_MINOR 14)
7+
set (tini_VERSION_PATCH 0)
88

99
# Build options
1010
option(MINIMAL "Disable argument parsing and verbose output" OFF)

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM ubuntu:trusty
22

3+
ARG ARCH_SUFFIX
4+
35
COPY ci/install_deps.sh /install_deps.sh
46
RUN /install_deps.sh
57

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ In Docker, you will want to use an entrypoint so you don't have to remember
5555
to manually invoke Tini:
5656

5757
# Add Tini
58-
ENV TINI_VERSION v0.13.2
58+
ENV TINI_VERSION v0.14.0
5959
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
6060
RUN chmod +x /tini
6161
ENTRYPOINT ["/tini", "--"]
@@ -81,7 +81,7 @@ The `tini` and `tini-static` binaries are signed using the key `595E85A6B1B4779E
8181
You can verify their signatures using `gpg` (which you may install using
8282
your package manager):
8383

84-
ENV TINI_VERSION v0.13.2
84+
ENV TINI_VERSION v0.14.0
8585
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
8686
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
8787
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
@@ -102,10 +102,10 @@ Using Nix, you can use the following command to install Tini:
102102

103103
nix-env --install tini
104104

105-
### ARM ###
105+
### Other Platforms ###
106106

107-
ARM images are available! Find the list of available platforms under the
108-
releases tab.
107+
ARM and 32-bit binaries are available! You can find the complete list of
108+
available binaries under [the releases tab][11].
109109

110110

111111
Options
@@ -245,6 +245,7 @@ Special thanks to:
245245

246246
[0]: https://github.com/krallin/tini/issues/8
247247
[10]: https://github.com/krallin/tini-images
248+
[11]: https://github.com/krallin/tini/releases
248249
[20]: https://github.com/krallin/
249250
[30]: https://github.com/tianon
250251
[31]: https://github.com/dpw

ci/install_deps.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
#!/bin/bash
22
set -o errexit
33
set -o nounset
4+
set -o xtrace
45

5-
apt-get update
6-
7-
apt-get install --no-install-recommends --yes \
6+
DEPS=(
87
build-essential git gdb valgrind cmake rpm \
98
python-dev libcap-dev python-pip python-virtualenv \
10-
hardening-includes gnupg \
11-
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross \
12-
gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabi libc6-dev-armhf-cross
9+
hardening-includes gnupg
10+
)
1311

12+
if [[ "$ARCH_SUFFIX" = "amd64" ]]; then
13+
true
14+
elif [[ "$ARCH_SUFFIX" = "armhf" ]]; then
15+
DEPS+=(gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabi libc6-dev-armhf-cross)
16+
elif [[ "$ARCH_SUFFIX" = "arm64" ]]; then
17+
DEPS+=(gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-dev-arm64-cross)
18+
elif [[ "$ARCH_SUFFIX" = "i386" ]]; then
19+
DEPS+=(libc6-dev-i386 gcc-multilib)
20+
else
21+
echo "Unknown ARCH_SUFFIX=${ARCH_SUFFIX}"
22+
exit 1
23+
fi
24+
25+
apt-get update
26+
apt-get install --no-install-recommends --yes "${DEPS[@]}"
1427
rm -rf /var/lib/apt/lists/*

ci/run_build.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set -o pipefail
77
# Default compiler
88
: ${CC:="gcc"}
99

10-
echo "CC=${CC}"
1110

1211
# Paths
1312
: ${SOURCE_DIR:="."}
@@ -30,12 +29,17 @@ export FORCE_SUBREAPER
3029

3130
# Our build platform doesn't have those newer Linux flags, but we want Tini to have subreaper support
3231
# We also use those in our tests
33-
CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
32+
CFLAGS="${CFLAGS-} -DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
3433
if [[ "${FORCE_SUBREAPER}" -eq 1 ]]; then
3534
# If FORCE_SUBREAPER is requested, then we set those CFLAGS for the Tini build
3635
export CFLAGS
3736
fi
3837

38+
echo "CC=${CC}"
39+
echo "CFLAGS=${CFLAGS}"
40+
echo "ARCH_SUFFIX=${ARCH_SUFFIX-}"
41+
echo "ARCH_NATIVE=${ARCH_NATIVE-}"
42+
3943
# Ensure Python output is not buffered (to make tests output clearer)
4044
export PYTHONUNBUFFERED=1
4145

@@ -53,16 +57,16 @@ cmake "${CMAKE_ARGS[@]}"
5357
pushd "${BUILD_DIR}"
5458
make clean
5559
make
56-
if [[ -n "${ARCH_NATIVE:=}" ]]; then
60+
if [[ -n "${ARCH_NATIVE-}" ]]; then
5761
make package
5862
fi
5963
popd
6064

6165
pkg_version="$(cat "${BUILD_DIR}/VERSION")"
6266

6367

64-
if [[ -n "${ARCH_NATIVE:=}" ]]; then
65-
echo "Built native package (ARCH_NATIVE=${ARCH_NATIVE})"
68+
if [[ -n "${ARCH_NATIVE-}" ]]; then
69+
echo "Built native package (ARCH_NATIVE=${ARCH_NATIVE-})"
6670
echo "Running smoke and internal tests"
6771

6872
BIN_TEST_DIR="${BUILD_DIR}/bin-test"
@@ -194,7 +198,7 @@ if [[ -n "${ARCH_NATIVE:=}" ]]; then
194198
# Run tests
195199
python "${SOURCE_DIR}/test/run_inner_tests.py"
196200
else
197-
if [[ ! -n "${ARCH_SUFFIX:=}" ]]; then
201+
if [[ ! -n "${ARCH_SUFFIX-}" ]]; then
198202
echo "Built cross package, but $ARCH_SUFFIX is empty!"
199203
exit 1
200204
fi
@@ -210,30 +214,30 @@ mkdir -p "${DIST_DIR}"
210214
TINIS=()
211215

212216
for tini in tini tini-static; do
213-
if [[ -n "${ARCH_SUFFIX:=}" ]]; then
217+
if [[ -n "${ARCH_SUFFIX-}" ]]; then
214218
to="${DIST_DIR}/${tini}-${ARCH_SUFFIX}"
215219
TINIS+=("$to")
216220
cp "${BUILD_DIR}/${tini}" "$to"
217221
fi
218222

219-
if [[ -n "${ARCH_NATIVE:=}" ]]; then
223+
if [[ -n "${ARCH_NATIVE-}" ]]; then
220224
to="${DIST_DIR}/${tini}"
221225
TINIS+=("$to")
222226
cp "${BUILD_DIR}/${tini}" "$to"
223227
fi
224228
done
225229

226-
if [[ -n "${ARCH_NATIVE:=}" ]]; then
230+
if [[ -n "${ARCH_NATIVE-}" ]]; then
227231
for pkg_format in deb rpm; do
228232
src="${BUILD_DIR}/tini_${pkg_version}.${pkg_format}"
229233

230-
if [[ -n "${ARCH_SUFFIX:=}" ]]; then
234+
if [[ -n "${ARCH_SUFFIX-}" ]]; then
231235
to="${DIST_DIR}/tini_${pkg_version}-${ARCH_SUFFIX}.${pkg_format}"
232236
TINIS+=("$to")
233237
cp "$src" "$to"
234238
fi
235239

236-
if [[ -n "${ARCH_NATIVE:=}" ]]; then
240+
if [[ -n "${ARCH_NATIVE-}" ]]; then
237241
to="${DIST_DIR}/tini_${pkg_version}.${pkg_format}"
238242
TINIS+=("$to")
239243
cp "$src" "$to"

ddist.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22
set -o errexit
33
set -o nounset
44

5+
if [[ "$#" != 1 ]]; then
6+
echo "Usage: $0 ARCH_SUFFIX"
7+
exit 1
8+
fi
9+
suffix="$1"
10+
511
REL_HERE=$(dirname "${BASH_SOURCE}")
612
HERE=$(cd "${REL_HERE}"; pwd)
713

8-
IMG="tini"
14+
IMG="tini-build-${suffix}"
915
SRC="/tini"
1016

1117
# Cleanup the build dir
1218
rm -f "${HERE}/dist"/*
1319

1420
# Create the build image
15-
docker build -t "${IMG}" .
21+
docker build --build-arg "ARCH_SUFFIX=${suffix}" -t "${IMG}" .
1622

1723
# Run test without subreaper support, don't copy build files here
1824
docker run -it --rm \
@@ -22,7 +28,8 @@ docker run -it --rm \
2228
-e FORCE_SUBREAPER="${FORCE_SUBREAPER:="1"}" \
2329
-e GPG_PASSPHRASE="${GPG_PASSPHRASE:=}" \
2430
-e CC="${CC:=gcc}" \
31+
-e CFLAGS="${CFLAGS-}" \
2532
-e ARCH_NATIVE="${ARCH_NATIVE-1}" \
26-
-e ARCH_SUFFIX="${ARCH_SUFFIX-}" \
33+
-e ARCH_SUFFIX="${suffix}" \
2734
-e MINIMAL="${MINIMAL-}" \
2835
"${IMG}" "${SRC}/ci/run_build.sh"

dtest.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set -o nounset
44

55
IMG="tini"
66

7+
if [[ "$#" != 1 ]]; then
8+
echo "Usage: $0 ARCH_SUFFIX"
9+
exit 1
10+
fi
11+
suffix="$1"
712

8-
docker build -t "${IMG}" .
9-
python test/run_outer_tests.py "${IMG}"
13+
IMG="tini-build-${suffix}"
14+
python test/run_outer_tests.py "${IMG}"

tpl/README.md.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ Using Nix, you can use the following command to install Tini:
102102

103103
nix-env --install tini
104104

105-
### ARM ###
105+
### Other Platforms ###
106106

107-
ARM images are available! Find the list of available platforms under the
108-
releases tab.
107+
ARM and 32-bit binaries are available! You can find the complete list of
108+
available binaries under [the releases tab][11].
109109

110110

111111
Options
@@ -245,6 +245,7 @@ Special thanks to:
245245

246246
[0]: https://github.com/krallin/tini/issues/8
247247
[10]: https://github.com/krallin/tini-images
248+
[11]: https://github.com/krallin/tini/releases
248249
[20]: https://github.com/krallin/
249250
[30]: https://github.com/tianon
250251
[31]: https://github.com/dpw

0 commit comments

Comments
 (0)