diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 16c32f85..00000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM registry.access.redhat.com/ubi8/ubi AS build -WORKDIR /go/src/app -RUN yum -y install golang make -COPY . . -RUN make - -FROM scratch -COPY --from=build /go/src/app/routes-controller . -ENTRYPOINT ["/routes-controller"] diff --git a/Makefile b/Makefile index 5255fa6a..27d10853 100644 --- a/Makefile +++ b/Makefile @@ -18,4 +18,4 @@ lint: .PHONY: image image: - ${CONTAINER_RUNTIME} build -t quay.io/crcont/routes-controller:$(TAG) . + ${CONTAINER_RUNTIME} build -t quay.io/crcont/routes-controller:$(TAG) -f images . diff --git a/images/Dockerfile b/images/Dockerfile new file mode 100644 index 00000000..50db83e0 --- /dev/null +++ b/images/Dockerfile @@ -0,0 +1,8 @@ +FROM registry.access.redhat.com/ubi8/go-toolset:1.14.12 AS build +WORKDIR $APP_ROOT/src +COPY . . +RUN make + +FROM scratch +COPY --from=build /opt/app-root/src/routes-controller . +ENTRYPOINT ["/routes-controller"]