Initial commit

This commit is contained in:
Tobias B 2021-11-12 08:33:47 +01:00
commit 587c6a0c13
No known key found for this signature in database
GPG Key ID: 5EF4C92355A3B53D
6 changed files with 51 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea/
.env

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM golang:1.17.2-alpine AS builder
WORKDIR /build
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
# build the program
RUN GO111MODULE=on CGO_ENABLED=0 go build -a -o ./out/app ./cmd/aqua
################
# run program
################
FROM alpine:3.10
COPY --from=builder /build/out/app .
CMD ["./app"]

1
README.md Normal file
View File

@ -0,0 +1 @@
# aqua

1
VERSION Normal file
View File

@ -0,0 +1 @@
0.1.0

7
cmd/aqua/main.go Normal file
View File

@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("Hello World!")
}

18
run.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# Get version of Go project from file
VERSION=$(<VERSION)
IMAGE="superioz/aqua:$VERSION"
# Check if the image is present on this machine
# If not, we build it ourselves
if !(docker image inspect $IMAGE &> /dev/null) || [[ $1 == "--rebuild" ]]; then
echo "Image $IMAGE is not present, building it .."
docker build -t $IMAGE .
fi
# we only need MSYS_NO_PATHCONV when running this script in Windows
# because otherwise Mingw will try to convert
# the given paths and that breaks everything.
MSYS_NO_PATHCONV=1 docker run -it --rm -p 8765:8765 $IMAGE