Skip to content

Commit

Permalink
docker: add a lkar only image
Browse files Browse the repository at this point in the history
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
  • Loading branch information
Adphi committed May 6, 2024
1 parent 2f760e1 commit fea4d40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM node:alpine as react-builder
FROM node:alpine AS react-builder

WORKDIR /app

Expand All @@ -25,7 +25,7 @@ COPY ui/ ./
RUN yarn build


FROM golang:alpine as go-builder
FROM golang:alpine AS go-builder

WORKDIR /app

Expand All @@ -48,7 +48,14 @@ RUN apk add --no-cache git make

RUN make build-go

FROM alpine:latest
FROM alpine:latest AS lkar

RUN apk upgrade --no-cache && apk --no-cache add ca-certificates
COPY --from=go-builder /app/bin/lkar /usr/local/bin/lkar

ENTRYPOINT ["/usr/local/bin/lkar"]

FROM alpine:latest AS full

RUN apk upgrade --no-cache && apk --no-cache add ca-certificates

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,21 @@ docker-scan: bin

.PHONY: docker-build
docker-build:
@docker buildx $(DOCKER_BUILDX_ARGS) -t $(REPOSITORY)/$(PROJECT):$(VERSION) -t $(REPOSITORY)/$(PROJECT):dev .
@docker buildx $(DOCKER_BUILDX_ARGS) --target full -t $(REPOSITORY)/$(PROJECT):$(VERSION) -t $(REPOSITORY)/$(PROJECT):dev .
@docker buildx $(DOCKER_BUILDX_ARGS) --target lkar -t $(REPOSITORY)/lkar:$(VERSION) -t $(REPOSITORY)/lkar:dev .
ifneq ($(TAG),)
@docker image tag $(REPOSITORY)/$(PROJECT):$(VERSION) $(REPOSITORY)/$(PROJECT):latest
@docker image tag $(REPOSITORY)/lkar:$(VERSION) $(REPOSITORY)/lkar:latest
endif

.PHONY: docker-push
docker-push:
@docker image push $(REPOSITORY)/$(PROJECT):$(VERSION)
@docker image push $(REPOSITORY)/$(PROJECT):dev
@docker image push $(REPOSITORY)/lkar:$(VERSION)
ifneq ($(TAG),)
@docker image push $(REPOSITORY)/$(PROJECT):latest
@docker image push $(REPOSITORY)/lkar:latest
endif

.PHONY: completions
Expand Down

0 comments on commit fea4d40

Please sign in to comment.