Skip to content

Commit

Permalink
Added a scan option to the management script and fixed and error when…
Browse files Browse the repository at this point in the history
… no Dockerfile exists
  • Loading branch information
TGWolf committed May 29, 2021
1 parent 0d52252 commit 8cc8cb4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
14 changes: 7 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ All notable changes to this project will be documented in this file.

This changelog was automatically generated using [Caretaker](https://github.com/DevelopersToolbox/caretaker) by [Wolf Software](https://github.com/WolfSoftware)

### [v0.1.2](https://github.com/DockerToolbox/goenv/compare/v0.1.1...v0.1.2)
### [Unreleased](https://github.com/DockerToolbox/goenv/compare/v0.1.2...HEAD)

- Added a scan option to the management script and fixed and error when no Dockerfile exists [`[head]`](https://github.com/DockerToolbox/goenv/commit/)

### [v0.1.1](https://github.com/DockerToolbox/goenv/compare/v0.1.0...v0.1.1)

> Released on May, 25th 2021
- Template all of the files required for auto-generation into one place to remove redundancy and repeated entries [`[head]`](https://github.com/DockerToolbox/goenv/commit/)
- Template all of the files required for auto-generation into one place to remove redundancy and repeated entries [`[0d52252]`](https://github.com/DockerToolbox/goenv/commit/0d52252c180f3915b7307ac91981d361566c0676)

- Minor tweaks to the auto-generation [`[d8059a3]`](https://github.com/DockerToolbox/goenv/commit/d8059a322cdda684b77183cab81b7f8b6e07073a)

### [v0.1.1](https://github.com/DockerToolbox/goenv/compare/v0.1.0...v0.1.1)
### [v0.1.0](https://github.com/DockerToolbox/goenv/releases/v0.1.0)

> Released on May, 24th 2021
Expand All @@ -23,9 +27,5 @@ This changelog was automatically generated using [Caretaker](https://github.com/

- Fix travis rvm versions and slack integration [`[a987387]`](https://github.com/DockerToolbox/goenv/commit/a987387d86fe6c13b9311a3fba9f8a235234e6fd)

### [v0.1.0](https://github.com/DockerToolbox/goenv/releases/v0.1.0)

> Released on February, 19th 2021
- The initial commit [`[63bdd44]`](https://github.com/DockerToolbox/goenv/commit/63bdd447ef11b36777bb0f395024ddb8cf593625)

15 changes: 14 additions & 1 deletion Scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function manage_container()
build)
build_container "${clean}"
;;
scan)
scan_container
;;
publish)
publish_container "${tags}"
;;
Expand Down Expand Up @@ -123,8 +126,11 @@ function generate_container()
PACKAGES=$(printf "%s\n%s" "${PACKAGES}" "${STATIC}")
fi

cp Dockerfile Dockerfile.bak
if [[ -f "Dockerfile" ]]; then
cp Dockerfile Dockerfile.bak
fi

touch Dockerfile
cat >Dockerfile <<EOL
FROM ${CONTAINER_OS_NAME}:${CONTAINER_OS_VERSION_ALT}
Expand Down Expand Up @@ -155,6 +161,13 @@ function build_container()
fi
}

function scan_container()
{
echo "${fgGreen}${bold}Scanning: ${LOCAL_CONTAINER_NAME}${reset}"
docker scan "${LOCAL_CONTAINER_NAME}"
echo "${fgGreen}${bold}Scan Complete: ${LOCAL_CONTAINER_NAME}${reset}"
}

function get_image_id()
{
IMAGE_ID=$(docker images -q "${LOCAL_CONTAINER_NAME}")
Expand Down

0 comments on commit 8cc8cb4

Please sign in to comment.