Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IaC Scan Runner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIACERE
public
The Platform
IaC Scan Runner
Commits
16d2a87e
Commit
16d2a87e
authored
3 years ago
by
Sašo Stanovnik
Committed by
Anze Luzar
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Slightly decrease the size of the docker artefact.
The size went from 2.57 GB to 1.80 GB.
parent
d51d7029
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.dockerignore
+2
-0
2 additions, 0 deletions
.dockerignore
Dockerfile
+40
-16
40 additions, 16 deletions
Dockerfile
install-checks.sh
+2
-5
2 additions, 5 deletions
install-checks.sh
with
44 additions
and
21 deletions
.dockerignore
+
2
−
0
View file @
16d2a87e
.git/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
40
−
16
View file @
16d2a87e
FROM
python:3.10.2-slim-bullseye
FROM
debian:bullseye-20220228-slim
# add python virtualenv and tools dir to path to be able to invoke commands
ENV
PATH="/iac-scan-runner/.venv/bin:/iac-scan-runner/tools:$PATH"
CMD
["uvicorn", "iac_scan_runner.api:app", "--host", "0.0.0.0", "--port", "80"]
# set working directory
WORKDIR
/iac-scan-runner/src
# copy all files
COPY
. /iac-scan-runner
WORKDIR
/iac-scan-runner
# install system and API requirements
RUN
apt-get update
\
&&
apt-get
-y
install
build-essential bash gcc git openssh-client ruby-full curl wget default-jdk nodejs npm
\
RUN
cd
/iac-scan-runner
\
&&
apt-get update
\
&&
apt-get
-y
install
--no-install-recommends
\
build-essential
\
bash
\
gcc
\
git
\
openssh-client
\
curl
\
wget
\
openjdk-17-jre
\
ruby2.7
\
nodejs
\
npm
\
unzip
\
python3
\
python3-pip
\
python3-venv
\
&&
apt-get update
\
&&
mkdir
-p
/usr/share/man/man1
\
&&
npm i npm@latest
-g
\
...
...
@@ -14,14 +34,18 @@ RUN apt-get update \
&&
.
.venv/bin/activate
\
&&
pip3
install
--upgrade
pip
\
&&
pip
install
-r
requirements.txt
\
&&
./install-checks.sh
&&
./install-checks.sh
\
&&
npm uninstall npm
\
&&
apt-get
-y
remove
\
build-essential
\
gcc
\
npm
\
curl
\
wget
\
&&
apt-get autoremove
-y
\
&&
apt-get autoclean
-y
\
&&
apt-get clean
-y
\
&&
rm
-rf
/var/lib/apt/lists/
*
\
&&
rm
-rf
/var/cache/
*
\
&&
rm
-rf
/root/.cache/
#add python virtualenv and tools dir to path to be able to invoke commands
ENV
PATH="/iac-scan-runner/.venv/bin:$PATH"
ENV
PATH="/iac-scan-runner/tools:$PATH"
# set working directory
WORKDIR
/iac-scan-runner/src
# start the API
CMD
["uvicorn", "iac_scan_runner.api:app", "--host", "0.0.0.0", "--port", "80"]
This diff is collapsed.
Click to expand it.
install-checks.sh
+
2
−
5
View file @
16d2a87e
...
...
@@ -6,7 +6,7 @@ export ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export
VIRTUALENV_DIR
=
"
${
ROOT_DIR
}
/.venv"
export
TOOLS_DIR
=
"
${
ROOT_DIR
}
/tools"
export
TMP_DIR
=
"
${
TOOLS_DIR
}
/tmp"
export
NODE_MODULES_DIR
=
"
${
T
OO
LS
_DIR
}
/node_modules"
export
NODE_MODULES_DIR
=
"
${
R
OO
T
_DIR
}
/node_modules"
export
CONFIG_DIR
=
"
${
ROOT_DIR
}
/config"
# env vars for check executables
export
OPERA_CHECK_PATH
=
"
${
VIRTUALENV_DIR
}
/bin/opera/"
...
...
@@ -90,10 +90,7 @@ installMarkdownLintIfNot() {
installRequiredNpmModulesIfNot
()
{
if
[
!
-f
"
$NODE_MODULES_DIR
"
]
;
then
cp
package.json
"
${
TOOLS_DIR
}
/package.json"
cp
package-lock.json
"
${
TOOLS_DIR
}
/package-lock.json"
npm i
--prefix
"
${
TOOLS_DIR
}
"
--force
rm
"
${
TOOLS_DIR
}
/package.json"
"
${
TOOLS_DIR
}
/package-lock.json"
npm
install
--force
fi
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment