circulartext commited on
Commit
649c393
·
1 Parent(s): 5783142

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -2
Dockerfile CHANGED
@@ -24,8 +24,17 @@ RUN chown -R user:user /app
24
  # Switch to the user for improved security
25
  USER user
26
 
27
- # Copy gosu from the packages image (assumed that gosu is already available in spaceread image)
28
- COPY --from=base /usr/sbin/gosu /usr/sbin/gosu
 
 
 
 
 
 
 
 
 
29
 
30
  # Copy entrypoint.sh separately
31
  COPY entrypoint.sh /usr/local/bin/entrypoint.sh
 
24
  # Switch to the user for improved security
25
  USER user
26
 
27
+ # Multi-stage build for installing gosu
28
+ FROM alpine as gosu_installer
29
+
30
+ # Install gosu in the alpine image
31
+ RUN apk --no-cache add gosu
32
+
33
+ # Final stage
34
+ FROM base
35
+
36
+ # Copy gosu from the gosu_installer image
37
+ COPY --from=gosu_installer /usr/sbin/gosu /usr/sbin/gosu
38
 
39
  # Copy entrypoint.sh separately
40
  COPY entrypoint.sh /usr/local/bin/entrypoint.sh