Add option to set a different user and password

pull/5/head
Juan Biondi 3 years ago
parent cc9d64d8fc
commit 67025c211b

@ -1,19 +1,24 @@
FROM alpine:latest FROM alpine:latest
ARG password=alpine
ARG user=alpine
LABEL maintainer="Don <novaspirit@novaspirit.com>" LABEL maintainer="Don <novaspirit@novaspirit.com>"
RUN apk add --no-cache sudo git xfce4 faenza-icon-theme bash python3 tigervnc xfce4-terminal\ RUN apk add --no-cache sudo git xfce4 faenza-icon-theme bash python3 tigervnc xfce4-terminal\
&& adduser -h /home/alpine -s /bin/bash -S -D alpine && echo -e "alpine\nalpine" | passwd alpine \ && adduser -h /home/$user -s /bin/bash -S -D $user \
&& echo 'alpine ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ && echo -e "${user} with password ${password}"\
&& echo -e "${password}\n${password}" | passwd $user \
&& echo '${user} ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& git clone https://github.com/novnc/noVNC /opt/noVNC \ && git clone https://github.com/novnc/noVNC /opt/noVNC \
&& git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify && git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify
USER alpine USER $user
WORKDIR /home/alpine WORKDIR /home/$user
RUN mkdir -p /home/alpine/.vnc \ RUN mkdir -p /home/$user/.vnc \
&& echo -e "#!/bin/bash\nstartxfce4 &" > /home/alpine/.vnc/xstartup \ && echo -e "#!/bin/bash\nstartxfce4 &" > /home/$user/.vnc/xstartup \
&& echo -e "alpine\nalpine\nn\n" | vncpasswd && echo -e "${password}\n${password}\nn\n" | vncpasswd
COPY entry.sh /entry.sh COPY entry.sh /entry.sh

@ -4,13 +4,12 @@ Simple and minimal Alpine Docker Image providing XFCE4 through html5 noVNC conne
<div align="center"> <div align="center">
[![Discord](https://img.shields.io/discord/316245914987528193?logo=discord)](https://discord.com/invite/v8dAnFV) [![Discord](https://img.shields.io/discord/316245914987528193?logo=discord)](https://discord.com/invite/v8dAnFV)
[![Youtube](https://img.shields.io/badge/YouTube-FF0000?style=flat-square&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UCrjKdwxaQMSV_NDywgKXVmw) [![Youtube](https://img.shields.io/badge/YouTube-FF0000?style=flat-square&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UCrjKdwxaQMSV_NDywgKXVmw)
[![Twitter URL](https://img.shields.io/twitter/follow/novaspirittech?style=flat-square&logo=twitter)](https://twitter.com/novaspirittech) [![Twitter URL](https://img.shields.io/twitter/follow/novaspirittech?style=flat-square&logo=twitter)](https://twitter.com/novaspirittech)
![GitHub repo size](https://img.shields.io/github/repo-size/novaspirit/Alpine_xfce4_noVNC?label=Repo%20Size&logo=github) ![GitHub repo size](https://img.shields.io/github/repo-size/novaspirit/Alpine_xfce4_noVNC?label=Repo%20Size&logo=github)
![Docker Build](https://github.com/novaspirit/Alpine_xfce4_noVNC/workflows/Docker/badge.svg) ![Docker Build](https://github.com/novaspirit/Alpine_xfce4_noVNC/workflows/Docker/badge.svg)
![Docker Pulls](https://img.shields.io/docker/pulls/novaspirit/alpine_xfce4_novnc) ![Docker Pulls](https://img.shields.io/docker/pulls/novaspirit/alpine_xfce4_novnc)
![Docker Size](https://img.shields.io/docker/image-size/novaspirit/alpine_xfce4_novnc) ![Docker Size](https://img.shields.io/docker/image-size/novaspirit/alpine_xfce4_novnc)
@ -25,6 +24,12 @@ git clone https://github.com/novaspirit/Alpine_xfce4_noVNC.git
docker build -t alpine-xfce4 Alpine_xfce4_noVNC/ docker build -t alpine-xfce4 Alpine_xfce4_noVNC/
``` ```
Optionally an user and password can be passed when building the image
```sh
docker build -t alpine-xfce4 --build-arg user=novaspirit --build-arg password="superstrongpassword" Alpine_xfce4_noVNC/
```
#### Run Image #### Run Image
```sh ```sh
@ -33,9 +38,7 @@ docker run -it -p 6080:6080 --name alpine-novnc alpine-xfce4
#### Connect With noVNC #### Connect With noVNC
Use modern browswer to connect to http://(docker ip):6080/vnc.html Use modern browswer to connect to http://(docker ip):6080/vnc.html the predefined password is `alpine`
the predefined password is `alpine`
#### LICENCE #### LICENCE

Loading…
Cancel
Save