File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -5,5 +5,9 @@ ENV MY_SERVICE_PORT2=80
55ENV MY_SERVICE_PORT3=80
66LABEL multi.label1="value1" multi.label2="value2" other="value3"
77ADD bin/amd64/httpserver /httpserver
8- EXPOSE 80
8+ EXPOSE 8080
9+ RUN useradd -m --uid 1000 web-admin && \
10+ echo "web-admin ALL=NOPASSWD: ALL" >> /etc/sudoers
11+ RUN chown web-admin /httpserver
12+ USER web-admin
913ENTRYPOINT ["/httpserver" ]
Original file line number Diff line number Diff line change 1- export tag =v1.0-metrics
1+ export tag =v1.0-nonroot
22root :
33 export ROOT=github.com/cncamp/golang
44
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ func main() {
3030 mux .Handle ("/metrics" , promhttp .Handler ())
3131
3232 srv := http.Server {
33- Addr : ":80 " ,
33+ Addr : ":8080 " ,
3434 Handler : mux ,
3535 }
3636 done := make (chan os.Signal , 1 )
You can’t perform that action at this time.
0 commit comments