Lab 6 Submission#1205
Open
G-Akleh wants to merge 5 commits into
Open
Conversation
Signed-off-by: G-Akleh <ghadeer_akleh@hotmail.com>
Signed-off-by: G-Akleh <ghadeer_akleh@hotmail.com>
Signed-off-by: G-Akleh <ghadeer_akleh@hotmail.com>
Signed-off-by: G-Akleh <ghadeer_akleh@hotmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Dockerize QuickNotes with a β€25 MB multi-stage image, a Compose stack with healthcheck + persistent volume, and the 6 container-security hardening defaults.
Changes
app/Dockerfileβ multi-stage build (golang:1.24-alpine builder β distroless/static:nonroot), staticCGO_ENABLED=0binary,-trimpath -ldflags='-s -w', runs as nonroot, final image 13.7 MBapp/healthcheck/main.goβ tiny static Go binary for the distroless healthcheck (no shell/curl/wget in the image)compose.yamlβquicknotesservice + named volumequicknotes-data:/data, exec-form healthcheck, env vars,restart: unless-stopped; a one-shotvolume-initsidecarchowns the volume so the nonroot app can seed it; hardened withcap_drop: [ALL],read_only: true,/tmptmpfs,no-new-privilegessubmissions/lab6.mdβ full write-up for Task 1, Task 2, and BonusTesting
docker imagesβ 13.7 MB (β€ 25 MB);docker inspectconfirmsUser=nonroot,EXPOSE 8080, exec-form entrypointdown && up, and is gone afterdown -v && up(back to 4 seed notes)docker inspect(CapDrop=[ALL],ReadonlyRootfs=true,SecurityOpt=[no-new-privileges:true]), no-shell exec fails as expected. Trivy scan did not complete due to vuln-DB download connectivity issues (documented in submission).Checklist
git log --show-signature)submissions/lab6.mdupdated