diff --git a/.dockerignore b/.dockerignore index 4347d4e..b5ffa83 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1 @@ goofys -.git diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml new file mode 100644 index 0000000..6c8d4f2 --- /dev/null +++ b/.github/workflows/docker-build.yaml @@ -0,0 +1,18 @@ +name: docker-build + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v5 + - name: build application + run: make docker-build + - name: check dist + run: ls -l dist/ && file dist/tigrisfs + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fbff9d8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:latest AS build + +RUN apt-get update && apt-get install -y git make wget curl sudo unzip golang shellcheck s3cmd util-linux fuse3 + +COPY --link . /src + +WORKDIR /src + +ENV CGO_ENABLED=0 + +RUN make setup +RUN make build + +FROM scratch +COPY --from=build /src/tigrisfs / diff --git a/Makefile b/Makefile index 600c5b3..0c4682d 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,10 @@ get-deps: s3proxy.jar build: go build $(BUILD_PARAM) +.PHONY: docker-build +docker-build: + docker build --output dist . + build-debug: CGO_ENABLED=1 go build -race $(BUILD_PARAM) diff --git a/go.mod b/go.mod index a353b50..c08fa8e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/tigrisdata/tigrisfs -go 1.24 +go 1.24.0 require ( cloud.google.com/go/storage v1.51.0