Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Security-Services-Code-Checking
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ComputerSecurity
Security-Services-Code-Checking
Commits
010ab8ff
Commit
010ab8ff
authored
8 years ago
by
Szymon Tomasz Datko
Browse files
Options
Downloads
Patches
Plain Diff
Base Dockerfile and build script, README update
parent
f3d68237
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+92
-0
92 additions, 0 deletions
Dockerfile
README.md
+22
-0
22 additions, 0 deletions
README.md
build.sh
+64
-0
64 additions, 0 deletions
build.sh
with
178 additions
and
0 deletions
Dockerfile
0 → 100644
+
92
−
0
View file @
010ab8ff
#
# Dockerfile for security-services/code-checking
#
# Maintainer:
# CERN IT-DI-CSO <computer.security@cern.ch>
#
#
# Base image and image metadata
#
FROM
centos:latest
MAINTAINER
"CERN IT-DI-CSO <computer.security@cern.ch>"
#
# Helpful variables
#
ENV
basedir /opt
#
# Enable extra repositories
#
RUN
yum
-y
install
epel-release
#
# Update the software and install basic development tools
#
RUN
yum
-y
update
RUN
yum
-y
groups
mark convert
RUN
yum
-y
groupinstall
'Development Tools'
#
# Install Python development packages
#
RUN
yum
-y
install
python-devel python-flake8 python-pep8
#
# Install general useful software
#
RUN
yum
-y
install
wget unzip unrar
sudo
RUN
yum
-y
install
p7zip p7zip-plugins
RUN
yum
-y
install
htop vim
#
# Install dependencies for RATS
#
RUN
yum
-y
install
expat expat-devel
RUN
yum
-y
install
flex flex-devel
#
# Install dependencies for PMD and FindBugs
#
RUN
yum
-y
install
java
#
# Install RATS
#
WORKDIR
$basedir
RUN
wget https://rough-auditing-tool-for-security.googlecode.com/files/rats-2.4.tgz
RUN
tar
-xzf
rats-2.4.tgz
WORKDIR
$basedir/rats-2.4
RUN
./configure
&&
make
&&
make
install
#
# Install PyLint
#
RUN
yum
-y
install
pylint
#
# Install PMD
#
WORKDIR
$basedir
RUN
wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F5.5.1/pmd-bin-5.5.1.zip
RUN
unzip pmd-bin-5.5.1.zip
#
# Install FindBugs
#
WORKDIR
$basedir
RUN
wget http://prdownloads.sourceforge.net/findbugs/findbugs-3.0.1.tar.gz
RUN
tar
-xzf
findbugs-3.0.1.tar.gz
This diff is collapsed.
Click to expand it.
README.md
+
22
−
0
View file @
010ab8ff
# Security-Services/Code-Checking
This repository contains Dockerfile with additional tools that are used
to build Docker image
**Security-Services/Code-Checking**
for automated
code checking with Gitlab-CI.
## Script usage
```
[fenek@Polluks Security-Services-Code-Checking]$ ./build.sh --help
Usage:
./build.sh [TAG]
./build.sh [-h|--help]
Arguments:
TAG -- tag string for image, current date by default
-h|--help -- display information about usage
Please, note that Docker service must be running on host.
```
This diff is collapsed.
Click to expand it.
build.sh
0 → 100755
+
64
−
0
View file @
010ab8ff
#!/bin/sh
#
# Script to build Docker image from Dockerfile
#
# Maintainer:
# CERN IT-DI-CSO <computer.security@cern.ch>
#
#
# Build parameters
#
REPOSITORY
=
'security-services'
IMAGENAME
=
'code-checking'
IMAGETAG
=
"
${
1
:-
$(
date
+
'%Y-%m-%d'
)
}
"
#
# Display help, if needed
#
if
[[
"
${
1
}
"
==
'-h'
||
"
${
1
}
"
==
'--help'
||
"
${#}
"
>
1
]]
;
then
echo
'Usage:'
echo
"
${
0
}
[TAG]"
echo
"
${
0
}
[-h|--help]"
echo
''
echo
'Arguments:'
echo
' TAG -- tag string for image, current date by default'
echo
' -h|--help -- display information about usage'
echo
''
echo
'Please, note that Docker service must be running on host.'
exit
0
fi
#
# Display image tag
#
echo
"Building image with tag:
${
IMAGETAG
}
"
echo
''
#
# Find and delete any previous image with specified tag
#
PREVIOUS
=
$(
docker images
\
|
grep
"
${
REPOSITORY
}
/
${
IMAGENAME
}
"
\
|
grep
-e
"
${
IMAGETAG
}
"
\
|
awk
'{ print $3; }'
\
|
sort
--unique
\
|
tr
'\n'
' '
\
|
sed
-e
's/^[[:space:]]*//'
-e
's/[[:space:]]*$//'
)
if
[[
!
-z
"
${
PREVIOUS
}
"
]]
;
then
docker rmi
--force
"
${
PREVIOUS
}
"
fi
#
# Build the image
#
docker build
\
--no-cache
=
'true'
\
--tag
=
"
${
REPOSITORY
}
/
${
IMAGENAME
}
:latest"
\
--tag
=
"
${
REPOSITORY
}
/
${
IMAGENAME
}
:
${
IMAGETAG
}
"
\
.
# Run inside current directory
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