Skip to content

Commit 0d08d02

Browse files
committed
feat(docker): use alpine for the base image
Use alpine for our base image since this reduces the container size by about half. Plus, most of this is just Python, bash, and make scripting anyway. Nothing Ubuntu specific anymore. Signed-off-by: Randolph Sapp <[email protected]>
1 parent 44389bf commit 0d08d02

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

docker/Dockerfile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,23 @@
11
# SPDX-License-Identifier: MIT
22
# Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com
33

4-
FROM debian:stable-slim
4+
FROM alpine:3
55

6-
RUN apt-get update \
7-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
8-
--no-install-recommends \
6+
RUN apk add --no-cache \
7+
bash \
98
dumb-init \
109
git \
11-
gosu \
1210
make \
13-
python3-pip \
11+
py3-pip \
1412
ripgrep \
13+
shadow \
14+
su-exec \
1515
zip \
1616
&& echo "**** create abc user and make our folders ****" \
1717
&& useradd -u 1000 -U -d /config -s /bin/false abc \
1818
&& usermod -G users abc \
1919
&& mkdir /build && chown abc:abc /build \
20-
&& mkdir /config && chown abc:abc /config \
21-
&& echo "**** cleanup ****" \
22-
&& apt-get autoremove \
23-
&& apt-get clean \
24-
&& rm -rf \
25-
/tmp/* \
26-
/var/cache/debconf/*-old \
27-
/var/lib/apt/lists/* \
28-
/var/lib/dpkg/status-old \
29-
/var/lib/sgml-base/supercatalog.old \
30-
/var/log/apt/term.log \
31-
/var/tmp/*
20+
&& mkdir /config && chown abc:abc /config
3221

3322
RUN --mount=type=bind,source=requirements.txt,target=/tmp/requirements.txt \
3423
python3 -m pip install -r /tmp/requirements.txt --no-cache-dir \

docker/root/init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ fi
4242
if [ "$(id -u)" == "$(id -u abc)" ]; then
4343
exec dumb-init -- "$@"
4444
else
45-
exec dumb-init -- gosu abc "$@"
45+
exec dumb-init -- su-exec abc:abc "$@"
4646
fi

0 commit comments

Comments
 (0)