Initial
This commit is contained in:
commit
86a77515f1
4 changed files with 44 additions and 0 deletions
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
FROM golang:alpine as build
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN go build
|
||||
|
||||
FROM alpine
|
||||
COPY --from=build /root/test /root/test
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["/root/test"]
|
11
README.md
Normal file
11
README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Firewall test container
|
||||
|
||||
## Build
|
||||
|
||||
$ docker build -t git.okoyono.de/f/firewall-test:latest .
|
||||
$ docker push git.okoyono.de/f/firewall-test:latest
|
||||
|
||||
## Run
|
||||
|
||||
$ docker pull git.okoyono.de/f/firewall-test
|
||||
$ docker run git.okoyono.de/f/firewall-test
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module test
|
||||
|
||||
go 1.19
|
21
test.go
Normal file
21
test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
resp, err := http.Get("https://aaron-fischer.net/ryg")
|
||||
if err != nil {
|
||||
fmt.Printf("err: %v", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Resp: %v", resp.Status)
|
||||
fmt.Fprintf(w, "Request from within the container to a website (Port 443): %v", resp.Status)
|
||||
})
|
||||
|
||||
log.Fatal(http.ListenAndServe(":5000", nil))
|
||||
}
|
Loading…
Reference in a new issue