Files
mrva-docker/containers/hepc/README.org

2.3 KiB

HEPC Container Image Build

Follow the Usage Sample in mrvahepc to set up the repository and data there. Then:

Build container

  cd ~/work-gh/mrva/mrva-docker/containers/hepc # this directory
  rm -fR ./mrvahepc && cp -r  ../../../mrvahepc .

  # Usual build
  docker build -t mrva-hepc-container:0.4.0 -f Dockerfile .

  # Build with full output, e.g. RUN ls 
  docker build --progress=plain --no-cache -t mrva-hepc-container:0.4.0 -f Dockerfile .

  # tag it
  cd ~/work-gh/mrva/mrva-docker/containers/hepc &&\
      docker tag mrva-hepc-container:0.4.0 \
             ghcr.io/hohn/mrva-hepc-container:0.4.0

  # Run standalone
  docker run -p 8070:8070 -ti mrva-hepc-container:0.4.0

  # Test server
  curl 127.0.0.1:8070/index -o - 2>/dev/null | wc -l

  curl 127.0.0.1:8070/api/v1/latest_results/codeql-all \
       -o - 2>/dev/null | wc -l

  url=$(curl 127.0.0.1:8070/api/v1/latest_results/codeql-all \
             -o - 2>/dev/null | head -1 | jq -r .result_url)
  echo $url
  # http://hepc/db/db-collection.tmp/aircrack-ng-aircrack-ng-ctsj-41ebbe.zip

  wget $(echo $url|sed 's|http://hepc|http://127.0.0.1:8070|g;')

Access this container

from host, when run by docker-compose

  cd ~/work-gh/mrva/mrva-docker/containers/hepc
  docker exec -it mrva-hepc bash

from another

  # Enter container
  docker exec -it mrva-docker-client-ghmrva-1 bash

  # Request index 
  curl hepc:8070/index

Push this container

  # Push container
  docker tag mrva-hepc-container:0.4.0 ghcr.io/hohn/mrva-hepc-container:0.4.0
  docker push ghcr.io/hohn/mrva-hepc-container:0.4.0

Test the registry image

  # Test pushed container
  docker pull ghcr.io/hohn/mrva-hepc-container:0.4.0

  docker run                                              \
         -p 8070:8070                                     \
         --name test-mrva-hepc-container                  \
         --rm -it ghcr.io/hohn/mrva-hepc-container:0.4.0


  curl 127.0.0.1:8070/index -o - 2>/dev/null | wc -l