diff --git a/docker/tests/Dockerfile b/docker/tests/Dockerfile index 65431a4cf..b8acb52a9 100644 --- a/docker/tests/Dockerfile +++ b/docker/tests/Dockerfile @@ -65,6 +65,14 @@ RUN wget -O /tmp/container-explorer-setup.sh https://raw.githubusercontent.com/g RUN chmod +x /tmp/container-explorer-setup.sh RUN sudo /tmp/container-explorer-setup.sh install +# Install docker CLI +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +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 +RUN apt-get update +RUN apt-get -y install docker-ce-cli +RUN groupadd docker +RUN usermod -aG docker turbinia + # Setup turbinia user folders and permissions RUN mkdir /etc/turbinia && mkdir -p /mnt/turbinia/ && mkdir -p /var/lib/turbinia/ \ && mkdir -p /etc/turbinia/ && chown -R turbinia:turbinia /etc/turbinia/ \ @@ -108,10 +116,11 @@ RUN python3 -m pip install poetry RUN poetry install --no-interaction --no-ansi -E worker --with test --no-root RUN poetry run python3 -m pip install impacket --no-deps -# Install Turbinia and dependencies in /home/turbinia/.venv using Poetry -ADD . /home/turbinia/ -# 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 +# Copy the source directory to the container +COPY --chown=turbinia:turbinia . /home/turbinia/ + RUN poetry install --no-interaction --no-ansi -E worker --with test + # We need to install the current dev version of turbinia-api-lib for the cli tool test in case the API client changes RUN cd turbinia/api/client && poetry install CMD ["/bin/bash"]