Skip to content

Instantly share code, notes, and snippets.

@victorfsf
Last active June 29, 2016 20:21
Show Gist options
  • Save victorfsf/67225e49aabe835967f2fa4576e05218 to your computer and use it in GitHub Desktop.
Save victorfsf/67225e49aabe835967f2fa4576e05218 to your computer and use it in GitHub Desktop.
Docker WebGoat
build:
@docker build -t webgoat .
run:
@docker run -d -ti --name webgoat -p 80:8080 webgoat
log:
@docker logs -f webgoat
stop:
@docker stop webgoat
rm:
@docker rm -f webgoat
rmi:
@docker rmi webgoat
build.run: build run
rm.all: rm rmi
Build Image:
Remember to save the file as Dockerfile and place it inside an empty folder!
$ docker build -t webgoat .
Run Container:
$ docker run -d -ti --name webgoat -p 80:8080 webgoat
Access:
http://localhost/WebGoat/
Logs:
$ docker logs -f webgoat
Stop Container:
$ docker stop webgoat
Remove (and Stop) Container:
$ docker rm -f webgoat
Remove Image:
$ docker rmi webgoat
FROM java:7
RUN apt-get update
RUN apt-get install curl -y
# Get newer versions here http://webgoat-war.s3-website-us-east-1.amazonaws.com/
# Using latest STABLE (by June 2016): v7.0.1
RUN curl -o webgoat.jar https://s3.amazonaws.com/webgoat-war/webgoat-container-7.0.1-war-exec.jar
CMD ["java", "-jar", "webgoat.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment