Skip to content

Commit 0618ac2

Browse files
committed
refactor: bump docker base
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent 7af3743 commit 0618ac2

File tree

1 file changed

+51
-45
lines changed

1 file changed

+51
-45
lines changed

pack/Dockerfile

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
# - GPUSTACK_RUNTIME_BASE_IMAGE: Base image for the gpustack-runtime stage.
1717
# - GPUSTACK_RUNTIME_ROCM_VERSION: Version of ROCm to vendor libraries from, update this if project dependencies has changed.
1818
# - GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS: Semicolon-separated list of labels to filter mirrored images when deploying mirrored deployment.
19-
ARG PYTHON_VERSION=3.11
19+
ARG PYTHON_VERSION=3.12
2020
ARG GPUSTACK_RUNTIME_BASE_IMAGE=runtime
2121
ARG GPUSTACK_RUNTIME_ROCM_VERSION=7.0.2
2222
ARG GPUSTACK_RUNTIME_DOCKER_MIRRORED_NAME_FILTER_LABELS
2323

24-
FROM ubuntu:22.04@sha256:3c61d3759c2639d4b836d32a2d3c83fa0214e36f195a3421018dbaaf79cbe37f AS runtime
24+
FROM ubuntu:24.04@sha256:d1e2e92c075e5ca139d51a140fff46f84315c0fdce203eab2807c7e495eff4f9 AS runtime
2525
SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
2626

2727
ARG TARGETPLATFORM
@@ -119,15 +119,15 @@ RUN <<EOF
119119

120120
# Install dependencies
121121
apt-get install -y --no-install-recommends \
122-
perl-openssl-defaults perl yasm \
123-
zlib1g zlib1g-dev libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev \
124-
openssl libssl-dev libsqlite3-dev lcov libomp-dev \
125-
libblas-dev liblapack-dev libopenblas-dev libblas3 liblapack3 libhdf5-dev \
126-
libxml2 libxslt1-dev libgl1-mesa-glx libgmpxx4ldbl \
127-
libncurses5-dev libreadline6-dev libsqlite3-dev \
128-
liblzma-dev lzma lzma-dev tk-dev uuid-dev libmpdec-dev \
122+
openssl libssl-dev \
123+
zlib1g zlib1g-dev libbz2-dev libffi-dev \
124+
lzma lzma-dev uuid-dev liblzma-dev \
129125
ffmpeg libjpeg-dev libpng-dev libtiff-dev libwebp-dev \
130-
libnuma-dev libjemalloc-dev
126+
libsqlite3-dev \
127+
libxml2 libxslt1-dev \
128+
libnuma1 libnuma-dev \
129+
libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev \
130+
libjemalloc-dev
131131

132132
# Cleanup
133133
rm -rf /var/tmp/* \
@@ -169,8 +169,11 @@ RUN <<EOF
169169
python${PYTHON_VERSION}-distutils \
170170
python${PYTHON_VERSION}-lib2to3 \
171171
python${PYTHON_VERSION}-gdbm \
172-
python${PYTHON_VERSION}-tk \
173-
libibverbs-dev
172+
python${PYTHON_VERSION}-tk
173+
if (( $(echo "${PYTHON_VERSION} <= 3.11" | bc -l) )); then
174+
apt-get install -y --no-install-recommends \
175+
python${PYTHON_VERSION}-distutils
176+
fi
174177

175178
# Update alternatives
176179
if [[ -f /etc/alternatives/python3 ]]; then update-alternatives --remove-all python3; fi; update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
@@ -243,47 +246,50 @@ ARG TARGETARCH
243246

244247
## Configure data volume
245248
VOLUME /var/lib/gpustack
246-
ENV GPUSTACK_RUNTIME_DOCKER_EPHEMERAL_FILES_DIR="/var/lib/gpustack/cache/gpustack-runtime"
247249

248250
## Install Skopeo
249251

252+
ARG GOPROXY="https://proxy.golang.org,direct"
253+
250254
RUN <<EOF
251255
# Skopeo
252256

253-
# Install Skopeo for images mirroring
254-
apt-get update -y && apt-get install -y --no-install-recommends \
255-
skopeo
257+
# Install Go
258+
curl --retry 3 --retry-connrefused -fL "https://go.dev/dl/go1.23.3.${TARGETOS}-${TARGETARCH}.tar.gz" | tar -zx -C /usr/local
259+
export PATH="/usr/local/go/bin:${PATH}"
260+
export GOPROXY="${GOPROXY}"
261+
export
262+
263+
# Download
264+
git -C /tmp clone --recursive --shallow-submodules \
265+
--depth 1 --branch v1.20.0 --single-branch \
266+
https://github.com/containers/skopeo.git skopeo
267+
268+
# Build and install
269+
pushd /tmp/skopeo \
270+
&& sed -i "/export GOPROXY=.*/d" Makefile \
271+
&& make vendor \
272+
&& DISABLE_DOCS=1 PREFIX=/usr make install-binary
273+
274+
# Configure Skopeo to allow insecure registries.
275+
mkdir -p /etc/containers
276+
cat<<EOT > /etc/containers/policy.json
277+
{
278+
"default": [
279+
{
280+
"type": "insecureAcceptAnything"
281+
}
282+
]
283+
}
284+
EOT
256285

257-
IFS="." read -r MAJOR MINOR PATCH <<< "$(skopeo --version | awk '{print $3}' | cut -d'-' -f1)"
258-
if (( MAJOR < 1 || ( MAJOR == 1 && MINOR < 21 ) )); then
259-
echo "Skopeo version ${MAJOR}.${MINOR} is lower than required 1.20.0, upgrading from source..."
286+
# Review
287+
skopeo --version
260288

261-
apt-get install -y --no-install-recommends \
262-
libgpgme-dev \
263-
libdevmapper-dev
264-
265-
# Install Go
266-
curl --retry 3 --retry-connrefused -fL "https://go.dev/dl/go1.23.3.${TARGETOS}-${TARGETARCH}.tar.gz" | tar -zx -C /usr/local
267-
export PATH="/usr/local/go/bin:${PATH}"
268-
269-
# Install Skopeo from source
270-
git -C /tmp clone --recursive --shallow-submodules \
271-
--depth 1 --branch v1.20.0 --single-branch \
272-
https://github.com/containers/skopeo.git skopeo
273-
274-
# Build and install
275-
pushd /tmp/skopeo \
276-
&& make vendor \
277-
&& DISABLE_DOCS=1 PREFIX=/usr make install-binary
278-
279-
# Review
280-
skopeo --version
281-
282-
# Cleanup
283-
go clean -cache -modcache -testcache \
284-
&& rm -rf /usr/local/go \
285-
&& rm -rf /root/.cache/go-build
286-
fi
289+
# Cleanup go
290+
go clean -cache -modcache -testcache \
291+
&& rm -rf /usr/local/go \
292+
&& rm -rf /root/.cache/go-build
287293

288294
# Cleanup
289295
rm -rf /var/tmp/* \

0 commit comments

Comments
 (0)