# docker nomachine 桌面

系統安裝nomachine

{% embed url="<https://www.nomachine.com/>" %}

快速測試

```
sudo docker run -d -p 4002:4000 --name desktop -e PASSWORD=password -e USER=user --cap-add=SYS_PTRACE cesarandreslopez/docker-ubuntu-mate-desktop-nomachine
```

```
git clone https://github.com/tristann9/docker-nomachine-desktop.git
cd docker-nomachine-desktop
docker build -t=kawsing/nomachine .
```

```
docker run -d -p 4001:4000 -p 23:22 --name desktop -e PASSWORD=test -e USER=test --cap-add=SYS_PTRACE desktop
```

```
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

ENV LANG="zh_TW.UTF-8"
ENV LANGUAGE=zh_TW


RUN apt-get clean && apt-get update && apt-get install -y locales && \
    locale-gen zh_TW.UTF-8 && locale-gen zh_TW && \
    echo "Asia/Taipei" > /etc/timezone && \
    apt-get install -y locales && \
    sed -i -e "s/# $LANG.*/$LANG.UTF-8 UTF-8/" /etc/locale.gen && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    update-locale LANG=$LANG && \
    apt-get update -y && \
    apt-get install -y fonts-droid-fallback software-properties-common python3-software-properties sudo && \
    add-apt-repository universe && \
    apt-get update -y && \
    apt-get install -y xterm pulseaudio cups curl \
    iputils-ping  libxss1 wget xdg-utils libpango1.0-0 fonts-liberation fonts-ubuntu \
    lxde firefox htop nano git vim


ADD nomachine_6.9.2_1_amd64.deb /

RUN dpkg -i /nomachine_6.9.2_1_amd64.deb
RUN rm -f /nomachine_6.9.2_1_amd64.deb

```

### 建立我的映像檔

```
sudo docker build -t kawsing/nomachinelxde .
```

### 啟動具備nomachine的docker桌面

```
sudo docker run -d -p 4003:4000 --name lxde -e PASSWORD=password -e USER=user --cap-add=SYS_PTRACE kawsing/nomachinelxde
```

使用nomachine登入 docker 桌面（影音都OK）

![](https://529150212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lh81JtaIQ84bwQqz_Wh%2F-M2GqGoIY-jJg-oFDwu5%2F-M2Gq_NWQd3WVoSsCiEf%2Fimage.png?alt=media\&token=4a661948-25bd-4af5-8e8a-c775e36246c6)
