Skip to content

Commit 3f95578

Browse files
authored
Upgrade containers to Ubuntu 24.04 base (#1572)
* Update docker files * Changes to docker files * Changes to workflows * Updates to workflows * Updates * Changes to github workflows
1 parent e17567f commit 3f95578

File tree

7 files changed

+46
-36
lines changed

7 files changed

+46
-36
lines changed

.github/workflows/actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os:
12-
- ubuntu-22.04
12+
- ubuntu-24.04
1313
gift_ppa_track: ["staging", "stable"]
1414
steps:
1515
- name: checkout

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os:
11-
- ubuntu-22.04
11+
- ubuntu-24.04
1212
gift_ppa_track: ["staging", "stable"]
1313
runs-on: ${{ matrix.os }}
1414
steps:

docker/api_server/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ COPY web/. .
77
RUN npm run build
88

99
# Build Turbinia API Server, copy from build, and setup rest of requirements
10-
FROM --platform=linux/amd64 ubuntu:22.04 as build-stage2
10+
FROM --platform=linux/amd64 ubuntu:24.04 as build-stage2
1111

1212
ENV DEBIAN_FRONTEND=noninteractive \
1313
PIP_NO_CACHE_DIR=1
1414

1515
COPY --from=build-stage /tmp/web/dist /web/dist
1616
RUN apt-get update && apt-get -y upgrade
17-
RUN apt-get -y install git python3-pip
18-
RUN pip3 install pip --upgrade
19-
RUN pip3 install poetry
17+
RUN apt-get -y install git python3-pip python3.12-venv
2018

2119
RUN useradd -r -s /sbin/nologin -u 999 turbinia
2220
RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia/ \
@@ -31,13 +29,16 @@ RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia
3129
USER turbinia
3230
WORKDIR /home/turbinia
3331

32+
# Install poetry
33+
RUN python3 -m venv .venv
34+
ENV PATH="/home/turbinia/.local/bin:/home/turbinia/.venv/bin:$PATH" \
35+
VIRTUAL_ENV=/home/turbinia/.venv
36+
RUN python3 -m pip install poetry
37+
3438
# Copy requirements and install dependencies to cache them in docker layer
3539
COPY --chown=turbinia:turbinia ./pyproject.toml ./poetry.toml ./poetry.lock /home/turbinia/
3640
RUN poetry install --no-interaction --no-ansi --no-root
3741

38-
ENV PATH="/home/turbinia/.venv/bin:$PATH" \
39-
VIRTUAL_ENV=/home/turbinia/.venv
40-
4142
# Copy the source directory to the container
4243
COPY --chown=turbinia:turbinia . /home/turbinia/
4344
COPY --chown=turbinia:turbinia docker/api_server/start.sh /home/turbinia/start.sh

docker/oauth2_proxy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update && apt-get -y upgrade

docker/server/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 ubuntu:22.04
1+
FROM --platform=linux/amd64 ubuntu:24.04
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
ENV PIP_NO_CACHE_DIR=1
@@ -9,13 +9,11 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install \
99
git \
1010
libterm-readline-gnu-perl \
1111
python3-pip \
12+
python3.12-venv \
1213
software-properties-common \
1314
sudo \
1415
&& apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/*
1516

16-
RUN pip3 install pip --upgrade
17-
RUN pip3 install poetry
18-
1917
RUN useradd -r -s /sbin/nologin -u 999 turbinia
2018

2119
RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia/ \
@@ -30,13 +28,16 @@ RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia
3028
USER turbinia
3129
WORKDIR /home/turbinia
3230

31+
# Install poetry
32+
RUN python3 -m venv .venv
33+
ENV PATH="/home/turbinia/.local/bin:/home/turbinia/.venv/bin:$PATH" \
34+
VIRTUAL_ENV=/home/turbinia/.venv
35+
RUN python3 -m pip install poetry
36+
3337
# Copy requirements and install dependencies to cache them in docker layer
3438
COPY --chown=turbinia:turbinia ./pyproject.toml ./poetry.toml ./poetry.lock /home/turbinia/
3539
RUN poetry install --no-interaction --no-ansi --no-root
3640

37-
ENV PATH="/home/turbinia/.venv/bin:$PATH" \
38-
VIRTUAL_ENV=/home/turbinia/.venv
39-
4041
# Copy the source directory to the container
4142
COPY --chown=turbinia:turbinia . /home/turbinia/
4243
COPY --chown=turbinia:turbinia docker/server/start.sh /home/turbinia/start.sh

docker/tests/Dockerfile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 ubuntu:22.04
1+
FROM --platform=linux/amd64 ubuntu:24.04
22
ENV DEBIAN_FRONTEND=noninteractive \
33
PIP_NO_CACHE_DIR=1
44
ARG PPA_TRACK=stable
@@ -22,19 +22,14 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install \
2222
p7zip-full \
2323
pkg-config \
2424
python3-pip \
25-
python3.10-venv \
25+
python3.12-venv \
2626
software-properties-common \
2727
sudo \
2828
testdisk \
2929
tox \
3030
wget \
3131
&& apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/*
3232

33-
# Install Poetry
34-
RUN pip3 install pip --upgrade
35-
RUN pip3 install poetry
36-
RUN pip3 install -U packaging
37-
3833
# Install various packages from the GIFT PPA
3934
# bulkextractor
4035
# docker-explorer
@@ -70,6 +65,14 @@ RUN wget -O /tmp/container-explorer-setup.sh https://raw.githubusercontent.com/g
7065
RUN chmod +x /tmp/container-explorer-setup.sh
7166
RUN sudo /tmp/container-explorer-setup.sh install
7267

68+
# Install docker CLI
69+
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
70+
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
71+
RUN apt-get update
72+
RUN apt-get -y install docker-ce-cli
73+
RUN groupadd docker
74+
RUN usermod -aG docker turbinia
75+
7376
# Setup turbinia user folders and permissions
7477
RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia/ \
7578
&& mkdir -p /etc/turbinia/ && chown -R turbinia:turbinia /etc/turbinia/ \
@@ -103,18 +106,21 @@ WORKDIR /home/turbinia
103106
# Copy only requirements, to cache them in docker layer
104107
COPY --chown=turbinia:turbinia ./pyproject.toml ./poetry.toml ./poetry.lock /home/turbinia/
105108

109+
# Install poetry
110+
RUN python3 -m venv .venv
111+
ENV PATH="/home/turbinia/.local/bin:/home/turbinia/.venv/bin:$PATH" \
112+
VIRTUAL_ENV=/home/turbinia/.venv
113+
RUN python3 -m pip install poetry
114+
106115
# Install dependencies using Poetry
107116
RUN poetry install --no-interaction --no-ansi -E worker --with test --no-root
108117
RUN poetry run python3 -m pip install impacket --no-deps
109118

110-
# Activate the virtualenv
111-
ENV PATH="/home/turbinia/.venv/bin:$PATH" \
112-
VIRTUAL_ENV=/home/turbinia/.venv
119+
# Copy the source directory to the container
120+
COPY --chown=turbinia:turbinia . /home/turbinia/
113121

114-
# Install Turbinia and dependencies in /home/turbinia/.venv using Poetry
115-
ADD . /home/turbinia/
116-
# RUN if $(cd /tmp/ && git rev-parse --is-shallow-repository); then cd /tmp/ && git fetch --prune --unshallow && git fetch --depth=1 origin +refs/tags/*:refs/tags/*; fi
117122
RUN poetry install --no-interaction --no-ansi -E worker --with test
123+
118124
# We need to install the current dev version of turbinia-api-lib for the cli tool test in case the API client changes
119125
RUN cd turbinia/api/client && poetry install
120126
CMD ["/bin/bash"]

docker/worker/Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build 1 - Turbinia Worker
2-
FROM --platform=linux/amd64 ubuntu:22.04
2+
FROM --platform=linux/amd64 ubuntu:24.04
33
ENV DEBIAN_FRONTEND=noninteractive \
44
PIP_NO_CACHE_DIR=1
55
ARG PPA_TRACK=stable
@@ -20,15 +20,13 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install \
2020
pocl-opencl-icd \
2121
p7zip-full \
2222
python3-pip \
23+
python3.12-venv \
2324
software-properties-common \
2425
sudo \
2526
testdisk \
2627
wget \
2728
&& apt-get clean && rm -rf /var/cache/apt/* /var/lib/apt/lists/*
2829

29-
RUN pip3 install pip --upgrade
30-
RUN pip3 install poetry
31-
3230
# Install various packages from the GIFT PPA
3331
# bulkextractor
3432
# docker-explorer
@@ -104,12 +102,16 @@ COPY --chown=turbinia:turbinia k8s/tools/check-lockfile.py /home/turbinia/check-
104102
USER turbinia
105103
WORKDIR /home/turbinia
106104

105+
# Install poetry
106+
RUN python3 -m venv .venv
107+
ENV PATH="/home/turbinia/.local/bin:/home/turbinia/.venv/bin:$PATH" \
108+
VIRTUAL_ENV=/home/turbinia/.venv
109+
RUN python3 -m pip install poetry
110+
107111
# Copy requirements and install dependencies to cache them in docker layer
108112
COPY --chown=turbinia:turbinia ./pyproject.toml ./poetry.toml ./poetry.lock /home/turbinia/
109113
RUN poetry install --no-interaction --no-ansi -E worker --no-root
110114
RUN poetry run pip3 install impacket --no-deps
111-
ENV PATH="/home/turbinia/.venv/bin:$PATH" \
112-
VIRTUAL_ENV=/home/turbinia/.venv
113115

114116
# Copy the source directory to the container
115117
COPY --chown=turbinia:turbinia . /home/turbinia/

0 commit comments

Comments
 (0)