mirror of https://github.com/Superioz/aqua.git
Initial commit
This commit is contained in:
commit
587c6a0c13
|
@ -0,0 +1,2 @@
|
|||
.idea/
|
||||
.env
|
|
@ -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"]
|
|
@ -0,0 +1,7 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello World!")
|
||||
}
|
|
@ -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
|
Loading…
Reference in New Issue