Skip to content

Commit

Permalink
testing docker
Browse files Browse the repository at this point in the history
  • Loading branch information
devsecfranklin committed Jun 2, 2024
1 parent 8350974 commit 6ad9f16
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
18 changes: 10 additions & 8 deletions .admin/docker/Dockerfile → .admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ FROM python:3.12-slim-bullseye
LABEL org.opencontainers.image.authors="nilknarf <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/DEAD10C5/1337-Noms-The-Hacker-Cookbook"
LABEL org.opencontainers.image.description="Ye Olde Hacker Cookbook"
LABEL org.opencontainers.image.licenses="CCC 1.0"
LABEL org.opencontainers.image.licenses="CC BY-ND 4.0 DEED"

ENV DEBIAN_FRONTEND noninteractive
ADD . /app
WORKDIR /app
WORKDIR /app/.admin

RUN \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367;\
apt update; \
apt install -y apt-utils;\
apt -y autoremove;\
apt install -y make git
apt-get update; \
apt-get install -y gnupg2 apt-utils;\
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367;\
apt-get -y autoremove;\
apt-get install -y make git

# Python3 setup
RUN pip3 install -rrequirements.txt
RUN ls;\
pip install --upgrade pip;\
pip3 install -rsrc/requirements.txt
7 changes: 4 additions & 3 deletions .admin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ clean:
@find . -name '*.pyc' | xargs rm -rf
@find . -name '__pycache__' | xargs rm -rf
@for trash in aclocal.m4 autom4te.cache config config.log config.status configure configure~ \
libtool Makefile Makefile.in docker/Makefile docker/Makefile.in; do \
libtool Makefile Makefile.in; do \
if [ -f $$trash ] || [ -d $$trash ]; then \
echo "Removing $$trash" ;\
rm -rf $$trash ;\
fi ; \
docker system prune -y
done

docker:
@if [ -f /.dockerenv ]; then echo "Don't run make docker inside docker container" && exit 1; fi
docker-compose -f docker/docker-compose.yml build hacker_cookbook
@docker-compose -f docker/docker-compose.yml run hacker_cookbook /bin/bash
docker-compose -f docker-compose.yml build hacker_cookbook
@docker-compose -f docker-compose.yml run hacker_cookbook /bin/bash

python:
python3 -m venv _build
Expand Down
7 changes: 7 additions & 0 deletions .admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ You can generate a PDF of this book.
### make docker

Build a Docker container with the application.

## OpenBSD

```sh
doas pkg_add latexmk
```

2 changes: 1 addition & 1 deletion .admin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function install_debian() {
# sudo apt install gnuplot gawk libtool psutils make autopoint
#declare -a Packages=( "doxygen" "gawk" "doxygen-latex" "automake" )
# sudo apt install gnuplot gawk libtool psutils make autoconf automake texlive-latex-extra fig2dev
declare -a Packages=("git" "make" "automake" "libtool") # "python3-pygit2" )
declare -a Packages=("git" "make" "m4" "autoconf" "libtool" ) # "python3-pygit2" )

# Container package installs will fail unless you do an initial update, the upgrade is optional
if [ "${CONTAINER}" = true ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ version: '3'
services:
hacker_cookbook:
build:
context: ..
dockerfile: docker/Dockerfile
context: ../.admin
dockerfile: Dockerfile
args:
USER_ID: ${USER_ID:-0}
GROUP_ID: ${GROUP_ID:-0}
Expand Down
3 changes: 0 additions & 3 deletions .admin/docker/README.md

This file was deleted.

0 comments on commit 6ad9f16

Please sign in to comment.