Build an environment where you can run GUI applications such as text editors on Docker.
The following will be explained in another article. --Enables Japanese input --Introduce a text editor (VSCode)
The following is not described. --Introduce docker, docker-compose
For the future, create a Docker image that allows you to: --bash-complete works effectively --A standard folder structure such as Download is created in the home folder when adding a user.
Dockerfile
FROM ubuntu
# ***********************************************
# install packages for xrdp, and do setting
# ***********************************************
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-utils sudo curl bash-completion
# ***********************************************
# setting skelton
# ***********************************************
RUN mkdir -p /etc/skel/Desktop \
/etc/skel/Downloads \
/etc/skel/Templates \
/etc/skel/Public \
/etc/skel/Documents \
/etc/skel/Music \
/etc/skel/Pictures \
/etc/skel/Videos
# ***********************************************
# bash complete
# ***********************************************
RUN mv /etc/apt/sources.list /etc/apt/sources.list.d/sources.list
# `apt-cache --no-generate ` can not work. I don't know why.
# so, apt-cache remove option "--no-generate"
RUN sed "s/--no-generate //g" /usr/share/bash-completion/completions/apt >/tmp/apt
RUN mv /tmp/apt /usr/share/bash-completion/completions/apt
RUN { \
echo "# enable programmable completion features (you don't need to enable"; \
echo "# this, if it's already enabled in /etc/bash.bashrc and /etc/profile"; \
echo "# sources /etc/bash.bashrc)."; \
echo "if ! shopt -oq posix; then"; \
echo " if [ -f /usr/share/bash-completion/bash_completion ]; then"; \
echo " . /usr/share/bash-completion/bash_completion"; \
echo " elif [ -f /etc/bash_completion ]; then"; \
echo " . /etc/bash_completion"; \
echo " fi"; \
echo "fi"; \
echo ""; \
} >> /root/.bashrc
Build container image
sudo docker build ./ -t sabocla6/ubuntu_base
Set the container image name as you like. However, since the container image will be created based on this container image in the following description, Change the base of that Dockerfile.
Dockerfile
FROM sabocla6/ubuntu_base
# ***********************************************
# install packages for xrdp, and do setting
# ***********************************************
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
zenity x11-apps
# ***********************************************
# setting keyboard layout
# ***********************************************
RUN { \
echo 'XKBMODEL="pc105"'; \
echo 'XKBLAYOUT="jp""'; \
echo 'XKBVARIANT=""'; \
echo 'XKBOPTIONS=""'; \
echo ''; \
echo 'BACKSPACE="guess"'; \
} > /etc/default/keyboard
Build container image
sudo docker build ./ -t sabocla6/ubuntu_ui
Set the container image name as you like.
Run VS Code on Docker Run GUI application on Docker container (Japanese input)
Recommended Posts