Pyboxs commited on
Commit
1088f52
1 Parent(s): 3e0e779

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -1,7 +1,6 @@
1
  # Filename: Dockerfile
2
  # Version: $(date +%s)
3
 
4
- # Utiliza Alpine como imagen base
5
  FROM alpine:latest
6
 
7
  # Instalar dependencias necesarias
@@ -13,24 +12,24 @@ RUN apk add --no-cache \
13
  curl \
14
  iptables \
15
  nginx \
16
- fuse-overlayfs shadow-uidmap
 
17
 
18
  # Crear un usuario no root
19
- RUN useradd -m dockeruser && echo "dockeruser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
20
 
21
  # Cambiar al usuario no root
22
  USER dockeruser
23
 
24
- # Instalar Docker rootless
25
- RUN curl -fsSL https://get.docker.com/rootless | sh
26
-
27
- # Configurar Docker rootless
28
- RUN echo 'export PATH=$HOME/bin:$PATH' >> /home/dockeruser/.bashrc
29
- RUN echo 'export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock' >> /home/dockeruser/.bashrc
30
- RUN mkdir -p /home/dockeruser/.config/systemd/user/
31
 
32
  # Crear el archivo de servicio para Docker rootless
33
- RUN echo '[Unit]\n\
 
34
  Description=Docker Application Container Engine (Rootless)\n\
35
  Documentation=https://docs.docker.com/go/rootless/\n\
36
  Wants=network-online.target\n\
@@ -75,4 +74,4 @@ EXPOSE 80
75
  EXPOSE 7680
76
 
77
  # Configurar el comando de inicio
78
- CMD ["sh", "-c", "dockerd-rootless.sh --experimental --host=tcp://0.0.0.0:7680 & nginx -g 'daemon off;'"]
 
1
  # Filename: Dockerfile
2
  # Version: $(date +%s)
3
 
 
4
  FROM alpine:latest
5
 
6
  # Instalar dependencias necesarias
 
12
  curl \
13
  iptables \
14
  nginx \
15
+ fuse-overlayfs \
16
+ shadow-uidmap
17
 
18
  # Crear un usuario no root
19
+ RUN adduser -D -g '' dockeruser && echo "dockeruser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
20
 
21
  # Cambiar al usuario no root
22
  USER dockeruser
23
 
24
+ # Configurar Docker rootless manualmente
25
+ RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-rootless-extras-20.10.7.tgz | tar -xz -C ~/
26
+ RUN ~/docker-rootless-extras/install
27
+ RUN echo 'export PATH=$HOME/bin:$PATH' >> /home/dockeruser/.profile
28
+ RUN echo 'export DOCKER_HOST=unix:///run/user/1000/docker.sock' >> /home/dockeruser/.profile
 
 
29
 
30
  # Crear el archivo de servicio para Docker rootless
31
+ RUN mkdir -p /home/dockeruser/.config/systemd/user/ && \
32
+ echo '[Unit]\n\
33
  Description=Docker Application Container Engine (Rootless)\n\
34
  Documentation=https://docs.docker.com/go/rootless/\n\
35
  Wants=network-online.target\n\
 
74
  EXPOSE 7680
75
 
76
  # Configurar el comando de inicio
77
+ CMD ["sh", "-c", "~/.docker-rootless-extras/docker-rootless.sh --experimental --host=tcp://0.0.0.0:7680 & nginx -g 'daemon off;'"]