Skip to content

Update docker command #325

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

Merged
merged 2 commits into from
Apr 9, 2025
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
6 changes: 3 additions & 3 deletions commands/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func makeDockerFile(port int) {
binary := binaries[0]

dockerfile := fmt.Sprintf(
"FROM ubuntu:24.04\n\n"+
"FROM ubuntu:latest\n\n"+
"RUN apt update && apt upgrade -y && apt install -y socat\n\n"+
"COPY %s .\n\n"+
"RUN echo \"flag{example}\" > flag.txt\n\n"+
Expand All @@ -52,7 +52,7 @@ func makeDockerFile(port int) {
log.Fatalln("error writing to file:", err)
}

fmt.Printf("🐋 "+theme.ColorGray+"ready to run:"+theme.ColorReset+" $ sudo docker build -t task . && sudo docker run -p %d:%d task\n", port, port)
fmt.Printf("🐋 "+theme.ColorGray+"ready to run:"+theme.ColorReset+" $ sudo docker build -t task . && sudo docker run --rm -it -p%d:%d task\n", port, port)
}

func Docker(args []string) {
Expand All @@ -63,7 +63,7 @@ func Docker(args []string) {
_, err := os.Stat("./Dockerfile")
if !os.IsNotExist(err) {
log.Fatalf("💥 "+theme.ColorRed+"error"+theme.ColorReset+": \"Dockerfile\" already exists!\n"+
"🐋 "+theme.ColorGray+"ready to run:"+theme.ColorReset+" $ sudo docker build -t task . && sudo docker run -p %d:%d task\n", port, port)
"🐋 "+theme.ColorGray+"ready to run:"+theme.ColorReset+" $ sudo docker build -t task . && sudo docker run --rm -it -p%d:%d task\n", port, port)
}

makeDockerFile(port)
Expand Down