Skip to content

Commit

Permalink
Merge pull request #191 from bancolombia/feature/DockerUpdates
Browse files Browse the repository at this point in the history
fix: Fix new issues with Docker
  • Loading branch information
luarredo authored Aug 28, 2024
2 parents ba55968 + 736e09a commit eb425d5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 37 deletions.
48 changes: 16 additions & 32 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM alpine@sha256:77726ef6b57ddf65bb551896826ec38bc3e53f75cdde31354fbffb4f25238ebd
FROM debian@sha256:aadf411dc9ed5199bc7dab48b3e6ce18f8bbee4f170127f5ff1b75cd8035eb36
WORKDIR /app

# Received args
ARG VERSION
ENV APP_VERSION=$VERSION

Expand All @@ -26,44 +25,29 @@ ENV DET_PIPELINE_NAME="" \
DET_PROJECT_NAME="" \
DET_REPOSITORY=""

# Container remote config creation
COPY /example_remote_config_local /app/example_remote_config_local
COPY /docker/remoteConfigGeneration.sh /app/remoteConfigGeneration.sh
RUN apt-get update && apt-get install -y bash
RUN apt-get update && apt-get install -y dos2unix

RUN chmod +x /app/remoteConfigGeneration.sh
RUN apk add --no-cache bash
RUN ./remoteConfigGeneration.sh
COPY ./example_remote_config_local /app/example_remote_config_local
COPY ./docker/remoteConfigGeneration.sh /app/remoteConfigGeneration.sh

COPY .envdetlocal /app/.env
RUN dos2unix /app/remoteConfigGeneration.sh

RUN apk update && \
apk add --no-cache \
docker \
openrc \
git \
build-base \
libffi-dev \
openssl-dev \
bzip2-dev \
zlib-dev \
readline-dev \
sqlite-dev \
wget \
xz
RUN chmod +x /app/remoteConfigGeneration.sh
RUN /bin/bash remoteConfigGeneration.sh

# Enable and start Docker service
RUN rc-update add docker boot
COPY .envdetlocal /app/.env

RUN apk add python3
RUN apk add py-pip
RUN apt-get update && \
apt-get install -y \
python3-venv \
python3-pip

# Ensure python3 points to the new version
RUN ln -s /usr/local/bin/python3 /usr/local/bin/python3 && \
ln -s /usr/local/bin/pip3 /usr/local/bin/pip3
RUN ln -s /usr/bin/python3 /usr/local/bin/python3 && \
ln -s /usr/bin/pip3 /usr/local/bin/pip3

RUN python3 -m venv venv
RUN source venv/bin/activate

RUN python3 -m pip install --break-system-packages checkov==2.3.296
RUN python3 -m pip install --break-system-packages -i https://pypi.org/simple devsecops-engine-tools==$APP_VERSION

CMD ["sh", "-c", "dockerd & while ! docker info > /dev/null 2>&1; do sleep 1; done; sh"]
7 changes: 3 additions & 4 deletions docker/remoteConfigGeneration.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

cp -r ../example_remote_config_local ./
mv example_remote_config_local docker_default_remote_config
json_file="docker_default_remote_config/engine_core/ConfigTool.json"
sed -i 's/"TOOL": "CHECKOV|KUBESCAPE|KICS"/"TOOL": "CHECKOV"/' "$json_file"
mv /app/example_remote_config_local /app/docker_default_remote_config
json_file="/app/docker_default_remote_config/engine_core/ConfigTool.json"
sed -i 's/"TOOL": "CHECKOV|KUBESCAPE|KICS"/"TOOL": "CHECKOV"/' "$json_file"
2 changes: 1 addition & 1 deletion tools/devsecops_engine_tools/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '1.8.6'
version = '1.8.7'

0 comments on commit eb425d5

Please sign in to comment.