diff --git a/Dockerfile b/Dockerfile index 3a8c111..1ae6a4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,24 @@ FROM alpine:latest +ARG password=alpine +ARG user=alpine + LABEL maintainer="Don " 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 \ - && echo 'alpine ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ + && adduser -h /home/$user -s /bin/bash -S -D $user \ + && 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/websockify /opt/noVNC/utils/websockify -USER alpine -WORKDIR /home/alpine +USER $user +WORKDIR /home/$user -RUN mkdir -p /home/alpine/.vnc \ - && echo -e "#!/bin/bash\nstartxfce4 &" > /home/alpine/.vnc/xstartup \ - && echo -e "alpine\nalpine\nn\n" | vncpasswd +RUN mkdir -p /home/$user/.vnc \ + && echo -e "#!/bin/bash\nstartxfce4 &" > /home/$user/.vnc/xstartup \ + && echo -e "${password}\n${password}\nn\n" | vncpasswd COPY entry.sh /entry.sh diff --git a/README.md b/README.md index 3559abb..4006975 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,12 @@ Simple and minimal Alpine Docker Image providing XFCE4 through html5 noVNC conne
-[![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) +[![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) [![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) -![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 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/ ``` +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 ```sh @@ -33,9 +38,7 @@ docker run -it -p 6080:6080 --name alpine-novnc alpine-xfce4 #### Connect With noVNC -Use modern browswer to connect to http://(docker ip):6080/vnc.html - -the predefined password is `alpine` +Use modern browswer to connect to http://(docker ip):6080/vnc.html the predefined password is `alpine` #### LICENCE