Skip to content

Commit

Permalink
Dockerise the application 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
k3yss committed Oct 28, 2023
1 parent ebd9926 commit b457ffa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.21.3-bookworm

RUN mkdir /build

ADD . /build/

WORKDIR /build/

RUN go build .

RUN apt-get update && apt-get install -y lsb-release

CMD ["./gofetch"]
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Gofetch
sudo docker build -t gofetch .
sudo docker run -it my-gofetch-app
Binary file modified gofetch
Binary file not shown.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ func main() {
if err != nil {
panic(err)
}

distroString := string(distro)
CollonIndex := strings.Index(distroString, ":")
distroName := strings.TrimSpace(distroString[CollonIndex+1:])

// RAM usage

mem := ReadMemoryStats()

totalMem := mem.MemTotal / 1024
Expand Down

0 comments on commit b457ffa

Please sign in to comment.