From 0edd84b66a769648491a579ba5327aea655189c6 Mon Sep 17 00:00:00 2001 From: Nicko Guyer Date: Wed, 10 Jan 2024 12:06:39 -0500 Subject: [PATCH] Change Dockerfile to use non-root user Signed-off-by: Nicko Guyer --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6127d0e..7955e2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ FROM golang:1.19-buster AS builder WORKDIR /ethconnect RUN apt-get update -y \ - && apt-get install -y build-essential git \ - && curl -Lo /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.15/solc-static-linux \ - && chmod 755 /usr/bin/solc + && apt-get install -y build-essential git \ + && curl -Lo /usr/bin/solc https://github.com/ethereum/solidity/releases/download/v0.8.15/solc-static-linux \ + && chmod 755 /usr/bin/solc ADD go.mod go.sum ./ RUN grep -v ethbinding go.mod > go.mod.new \ - && cp go.mod.new go.mod + && cp go.mod.new go.mod RUN go get github.com/kaleido-io/ethbinding RUN go mod download ADD . . @@ -27,4 +27,6 @@ RUN apt-get update \ && ln -s /ethconnect/ethconnect /usr/bin/ethconnect RUN mkdir abis +USER 1001 + ENTRYPOINT [ "./start.sh" ]