Last active
December 7, 2022 08:22
-
-
Save ysenkun/3871e58d189f2dd0da66927b4c66076c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#実行方法 | |
#$ docker build -f ./Dockerfile -t {image_name} . | |
#$ docker run -itd --privileged -p 13389:3389 --hostname {hostname} --name {container_name} {image_name} /sbin/init | |
#rdpで接続 | |
#------------------------ | |
FROM ubuntu:20.04 | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV TZ=Asia/Tokyo | |
#日本のミラーサーバーを使用 | |
RUN perl -p -i.bak -e 's%https?://(?!security)[^ \t]+%http://jp.archive.ubuntu.com/ubuntu/%g' /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get -y install ubuntu-desktop | |
RUN rm /run/reboot-required* | |
RUN useradd -m {username} | |
RUN gpasswd -a {username} sudo | |
RUN echo '{username}:{user_password}' | chpasswd | |
RUN apt install -y xrdp | |
RUN adduser xrdp ssl-cert | |
RUN sed -i '3 a echo "\ | |
export GNOME_SHELL_SESSION_MODE=ubuntu\\n\ | |
export XDG_SESSION_TYPE=x11\\n\ | |
export XDG_GURRENT_DESKTOP=ubuntu:GNOME\\n\ | |
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg\\n\ | |
" > ~/.xsessionrc' /etc/xrdp/startwm.sh | |
EXPOSE 3389 | |
CMD service dbus start; /usr/lib/systemd/systemd-logind & service xrdp start ; bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行方法をコメントアウトで追加