Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
binwalk
Commits
3f50064e
Commit
3f50064e
authored
Mar 15, 2021
by
Peter Eacmen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement multi-stage build and test stage, include Docker build in Travis integration testing
parent
afe921fc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
42 deletions
+51
-42
.dockerignore
.dockerignore
+6
-0
.travis.yml
.travis.yml
+20
-8
Dockerfile
Dockerfile
+25
-34
No files found.
.dockerignore
View file @
3f50064e
...
@@ -3,3 +3,9 @@ dist
...
@@ -3,3 +3,9 @@ dist
.coverage
.coverage
*.extracted
*.extracted
*.pyc
*.pyc
.editorconfig
.gitignore
images
Dockerfile
.dockerignore
.git
.travis.yml
View file @
3f50064e
...
@@ -13,19 +13,31 @@ script: ./setup.py test
...
@@ -13,19 +13,31 @@ script: ./setup.py test
cache
:
pip
cache
:
pip
jobs
:
jobs
:
include
:
include
:
-
dist
:
bionic
-
stage
:
test
dist
:
bionic
python
:
3.6
python
:
3.6
-
dist
:
bionic
-
stage
:
test
dist
:
bionic
python
:
3.7
python
:
3.7
-
dist
:
bionic
-
stage
:
test
dist
:
bionic
python
:
3.8
python
:
3.8
-
dist
:
bionic
-
stage
:
test
dist
:
bionic
python
:
3.9
python
:
3.9
-
dist
:
focal
-
stage
:
test
dist
:
focal
python
:
3.6
python
:
3.6
-
dist
:
focal
-
stage
:
test
dist
:
focal
python
:
3.7
python
:
3.7
-
dist
:
focal
-
stage
:
test
dist
:
focal
python
:
3.8
python
:
3.8
-
dist
:
focal
-
stage
:
test
dist
:
focal
python
:
3.9
python
:
3.9
-
stage
:
test
services
:
docker
install
:
-
docker build .
Dockerfile
View file @
3f50064e
FROM
python:3-buster
FROM
python:3-buster
AS build-and-install
ENV
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/src/app/bin
ENV
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/src/app/bin \
DEBIAN_FRONTEND=noninteractive \
# Make stdout/stderr unbuffered. This prevents delay between output and cloud.
SASQUATCH_COMMIT=3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed \
# Might not be needed by all apps, but slow ALL of them. test per app/container
UBIREADER_COMMIT=0955e6b95f07d849a182125919a1f2b6790d5b51 \
#ENV PYTHONUNBUFFERED "1"
BINWALK_COMMIT=3154b0012e7dbaf2b20edd5c0a2350ec64009869
### To prevent the Debian installer from freaking out on configuration of packages
ENV
DEBIAN_FRONTEND noninteractive
# Pinned versions of few oddball dependencies
ENV
SASQUATCH_COMMIT 3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed
ENV
UBIREADER_COMMIT 0955e6b95f07d849a182125919a1f2b6790d5b51
ENV
BINWALK_COMMIT 3154b0012e7dbaf2b20edd5c0a2350ec64009869
COPY
. /tmp
COPY
. /tmp
WORKDIR
/tmp
WORKDIR
/tmp
### Took out the deps.sh from binwalk's installation script, baked in the dependencies into the main prereqs installation
### Took out the deps.sh from binwalk's installation script, baked in the dependencies into the main prereqs installation
...
@@ -25,36 +16,36 @@ RUN set -xue \
...
@@ -25,36 +16,36 @@ RUN set -xue \
&&
apt-get
-t
buster dist-upgrade
-yq
--no-install-recommends
-o
Dpkg::Options::
=
"--force-confold"
\
&&
apt-get
-t
buster dist-upgrade
-yq
--no-install-recommends
-o
Dpkg::Options::
=
"--force-confold"
\
&&
./deps.sh
--yes
\
&&
./deps.sh
--yes
\
&&
python3 setup.py install
&&
binwalk
-h
>
/dev/null
\
&&
python3 setup.py install
&&
binwalk
-h
>
/dev/null
\
&&
apt-get
-yq
purge
*
-dev
git build-essential gcc g++
\
&&
apt-get
-y
autoremove
\
&&
apt-get
-y
autoclean
\
&&
echo
"en_US.UTF-8 UTF-8"
>>
/etc/locale.gen
\
&&
echo
"en_US.UTF-8 UTF-8"
>>
/etc/locale.gen
\
&&
echo
"LANG=en_US.UTF-8"
>>
/etc/default/locale
\
&&
echo
"LANG=en_US.UTF-8"
>>
/etc/default/locale
\
&&
echo
"LANGUAGE=en_US:en"
>>
/etc/default/locale
\
&&
echo
"LANGUAGE=en_US:en"
>>
/etc/default/locale
\
&&
echo
"LC_ALL=en_US.UTF-8"
>>
/etc/default/locale
\
&&
echo
"LC_ALL=en_US.UTF-8"
>>
/etc/default/locale
\
&&
locale-gen
\
&&
locale-gen
&&
apt-get
-y
autoremove
\
&&
apt-get
-y
autoclean
\
FROM
build-and-install AS unit-tests
&&
useradd
-m
-u
1000
-s
/sbin/nologin appuser
\
RUN
pip install coverage nose
\
&&
python3 setup.py
test
\
&&
dd
if
=
/dev/urandom
of
=
/tmp/random.bin
bs
=
1M
count
=
1
&&
binwalk
-J
-E
/tmp/random.bin
FROM
build-and-install AS cleanup-and-release
RUN
useradd
-m
-u
1000
-s
/sbin/nologin appuser
\
&&
rm
-rf
--
\
&&
rm
-rf
--
\
/var/lib/apt/lists/
*
\
/var/lib/apt/lists/
*
\
/tmp/
*
/var/tmp/
*
\
/tmp/
*
/var/tmp/
*
\
/usr/src/app/
*
.whl /usr/src/app/
*
.tar.gz
\
/root/.cache/pip
/root/.cache/pip
\
/usr/src/app/repos
\
/usr/src/app/.git
\
/usr/src/app/src
ENV
DEBIAN_FRONTEND teletype
# Setup locale. This prevents Python 3 IO encoding issues.
# Setup locale. This prevents Python 3 IO encoding issues.
ENV
LANG en_US.UTF-8
ENV
DEBIAN_FRONTEND=teletype \
ENV
LANGUAGE en_US:en
LANG=en_US.UTF-8 \
ENV
LC_ALL en_US.UTF-8
LANGUAGE=en_US:en \
ENV
PYTHONUTF8 "1"
LC_ALL=en_US.UTF-8 \
ENV
PYTHONHASHSEED "random"
PYTHONUTF8="1" \
PYTHONHASHSEED="random"
WORKDIR
/home/appuser
WORKDIR
/home/appuser
USER
appuser
USER
appuser
# dummy run because it creates some files on first run in home dir
RUN
binwalk
-h
>
/dev/null
ENTRYPOINT
["binwalk"]
ENTRYPOINT
["binwalk"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment