Broken Environment
is a test environment where you need to fix the environment so it is run as needed.
Do read all the scripts given to you before executing any (:
- docker
- shell (bash)
- make
- jq
broken-env:demo
docker image is created successfully by usingmake build
broken-env:demo
docker image endpoint is accessible from host machine by usingmake run
andcurl -s localhost:8228/
from host machinebroken-env:demo
docker image endpoint is returning a JSON similar to this{"built_at":"date"}
wheredate
is the datetime the image is built generated by thepre.sh
with predefined formatbroken-env:demo
docker image and running container can be removed by usingmake cleanup
You can change basically every files inside this directory except test.sh
to help you make sure the goals are accomplished. Make a write up about your solution below will be a plus point (:
For easier testing, you can execute make test
to run all commands programatically.
make test
is only a helper command, not a judge.
After all the goals are accomplished, before send back to us, you need to compress your solution into zip/tar
which consists of these files:
- Dockerfile
- Makefile
- post.sh
- pre.sh
- README.md
- test.sh
Append this documentation on how you fix all the script
- In dockerfile add as base => (FROM golang:1.17.5-alpine3.14 as base )
- In make file add -p 8228:8228 => (@docker run --name broken-env-demo -d -p 8228:8228 --rm -it broken-env:demo)
- In post.sh delete /go.mod /main.go => (rm go.mod main.go)
- In pre.sh delete space built_at = => (built_at=
date -u "+%d-%m-%y@%H"
)