From e1095544e1640ee0075a617c5b95475510489a0c Mon Sep 17 00:00:00 2001 From: Prashant Srivastava <50466688+srprash@users.noreply.github.com> Date: Fri, 16 Apr 2021 12:14:54 -0700 Subject: [PATCH] Create Dockerfile with base as amazonlinux (#130) * Create Dockerfile_base_amazonlinux This dockerfile will be used to create daemon image with the amazonlinux base image * Rename Dockerfile_base_amazonlinux to Dockerfile.amazonlinux --- Dockerfile.amazonlinux | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Dockerfile.amazonlinux diff --git a/Dockerfile.amazonlinux b/Dockerfile.amazonlinux new file mode 100644 index 0000000..38d5551 --- /dev/null +++ b/Dockerfile.amazonlinux @@ -0,0 +1,21 @@ +# build stage +FROM --platform=$BUILDPLATFORM golang:1.15-alpine AS build-env +ARG TARGETPLATFORM + +RUN apk update && apk add ca-certificates + +WORKDIR /workspace + +COPY . . + +RUN adduser -D -u 10001 xray +ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} +RUN Tool/src/build-in-docker.sh + +FROM amazonlinux +COPY --from=build-env /workspace/xray . +COPY --from=build-env /etc/passwd /etc/passwd +COPY --from=build-env /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY pkg/cfg.yaml /etc/amazon/xray/cfg.yaml +USER xray +ENTRYPOINT ["/xray"]