forked from 0x90/kali-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Dockerfile and build.sh from offensive-security/kali-linux-docker
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM kalilinux/kali-linux-docker | ||
# Metadata params | ||
ARG BUILD_DATE | ||
ARG VERSION | ||
ARG VCS_URL | ||
ARG VCS_REF | ||
|
||
LABEL org.label-schema.build-date=$BUILD_DATE \ | ||
org.label-schema.vcs-url=$VCS_URL \ | ||
org.label-schema.vcs-ref=$VCS_REF \ | ||
org.label-schema.version=$VERSION \ | ||
org.label-schema.name='Kali Linux' \ | ||
org.label-schema.description='Official Kali Linux docker image' \ | ||
org.label-schema.usage='https://www.kali.org/news/official-kali-linux-docker-images/' \ | ||
org.label-schema.url='https://www.kali.org/' \ | ||
org.label-schema.vendor='Offensive Security' \ | ||
org.label-schema.schema-version='1.0' \ | ||
org.label-schema.docker.cmd='docker run --rm kalilinux/kali-linux-docker' \ | ||
org.label-schema.docker.cmd.devel='docker run --rm -ti kalilinux/kali-linux-docker' \ | ||
org.label-schema.docker.debug='docker logs $CONTAINER' \ | ||
io.github.offensive-security.docker.dockerfile="Dockerfile" \ | ||
io.github.offensive-security.license="GPLv3" \ | ||
MAINTAINER="Steev Klimaszewski <steev@kali.org>" | ||
RUN echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" > /etc/apt/sources.list && \ | ||
echo "deb-src http://http.kali.org/kali kali-rolling main contrib non-free" >> /etc/apt/sources.list | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN set -x \ | ||
&& apt-get -yqq update \ | ||
&& apt-get -yqq dist-upgrade \ | ||
&& apt-get clean | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Install dependencies (debbootstrap) | ||
sudo apt-get install -yqq debootstrap curl | ||
|
||
# ----------------------------------------------------------------------------- | ||
# BUILD/LABEL VARIABLES | ||
# ----------------------------------------------------------------------------- | ||
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
VERSION="latest" | ||
VCS_URL=$(git config --get remote.origin.url) | ||
VCS_REF=$(git rev-parse --short HEAD) | ||
|
||
# Fetch the latest Kali debootstrap script from git | ||
curl "http://git.kali.org/gitweb/?p=packages/debootstrap.git;a=blob_plain;f=scripts/kali;h=50d7ef5b4e9e905cc6da8655416cdf3ef559911e;hb=refs/heads/kali/master" > kali-debootstrap &&\ | ||
sudo debootstrap kali-rolling ./kali-root http://repo.kali.org/kali ./kali-debootstrap &&\ | ||
sudo tar -C kali-root -c . | sudo docker import - kalilinux/kali-linux-docker &&\ | ||
sudo rm -rf ./kali-root &&\ | ||
TAG=$(sudo docker run -t -i kalilinux/kali-linux-docker awk '{print $NF}' /etc/debian_version | sed 's/\r$//' ) &&\ | ||
echo "Tagging kali with $TAG" &&\ | ||
sudo docker tag kalilinux/kali-linux-docker:$VERSION kalilinux/kali-linux-docker:$TAG &&\ | ||
echo "Labeling kali" &&\ | ||
sudo docker build --squash --rm -t kalilinux/kali-linux-docker:$VERSION \ | ||
--build-arg BUILD_DATE=$BUILD_DATE \ | ||
--build-arg VERSION=$VERSION \ | ||
--build-arg VCS_URL=$VCS_URL \ | ||
--build-arg VCS_REF=$VCS_REF . &&\ | ||
echo "Build OK" || echo "Build failed!" |