- Updated stage1 to build modelmgmtservice golang binary
- Added stage2 to run modelmgmtservice golang binary with compact
environment
- Change alpine tag from 'latest' to '3.20' for fixing development environment
Issue-ID: AIMLFW-116
Change-Id: Idce95bef25c4505f0edb0a810bfebdc96b89283a
Signed-off-by: gyuyoung <gyoue200125@gmail.com>
#
# ==================================================================================
#Base Image
-FROM golang:1.21
+FROM golang:1.21-alpine AS builder
# location in the container
ENV MME_DIR /home/app/
#Build all packages from current dir into bin
RUN go build -o mme_bin .
+FROM alpine:3.20
+
+RUN apk update && apk add bash
+RUN apk add --no-cache bash
+
+WORKDIR /app
+
+COPY --from=builder /home/app/mme_bin .
+
#Start the app
-ENTRYPOINT [ "sh", "-c", "${MME_DIR}/mme_bin"]
+ENTRYPOINT ["/app/mme_bin"]
#Expose the ports for external communication
EXPOSE 8082