Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Ciphey Dockerfile #39

Merged
merged 1 commit into from
Aug 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions ciphey/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
# Notes: ciphey
#
# To run Ciphey using this Docker container, create a directory where you'll store
# your input and output files. Then, use a command like this to open a shell inside
# the container where you can run "ciphey" and have your directory mapped as
# /home/nonroot/workdir inside the container:
# your input files, e.g. ~/workdir/input.txt. Then, use a command like this to run "ciphey"
# and have your directory mapped as /home/nonroot/workdir inside the container:
#
# docker run -it --rm -v ~/workdir:/home/nonroot/workdir remnux/ciphey
# docker run -it --rm -v ~/workdir:/home/nonroot/workdir remnux/ciphey -f input.txt
#
# The password for the container's user nonroot is nonroot. The remnux/ciphey image is
# hosted on its its Docker Hub page.
# Or for a text input:
# docker run -it --rm remnux/ciphey "=MXazlHbh5WQgUmchdHbh1EIy9mZgQXarx2bvRFI4VnbpxEIBBiO4VnbNVkU"
#
# The remnux/ciphey image is hosted on its Docker Hub page.

FROM ubuntu:18.04
LABEL version="1.0"
FROM python:3.8.5-slim-buster
LABEL version="1.1"
LABEL description="Ciphey - An Automated Decoding and Decryption Tool"
LABEL maintainer="Lenny Zeltser"
ENV LANG C.UTF-8
Expand All @@ -25,22 +26,17 @@ ENV LC_ALL C.UTF-8

USER root

RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-pip sudo && \
rm -rf /var/lib/apt/lists/*

RUN pip3 install --upgrade pip && \
python3 -m pip install ciphey

RUN groupadd -r nonroot && \
pip3 install --upgrade ciphey && \
groupadd -r nonroot && \
useradd -m -r -g nonroot -d /home/nonroot -s /usr/sbin/nologin -c "Nonroot User" nonroot && \
mkdir -p /home/nonroot/workdir && \
chown -R nonroot:nonroot /home/nonroot && \
usermod -a -G sudo nonroot && echo 'nonroot:nonroot' | chpasswd
chown -R nonroot:nonroot /home/nonroot

USER nonroot
ENV HOME /home/nonroot
WORKDIR /home/nonroot/workdir
VOLUME ["/home/nonroot/workdir"]
ENV USER nonroot
CMD ["/bin/bash"]
ENTRYPOINT ["/usr/local/bin/ciphey"]
CMD ["--help"]