Docker Compose NOT Using Existing Volume for Windows 10 Container
Operating system
Ubuntu 22
Description
Hello,
Windows 10 container on a Proxmox LXC environment. I had created this container some time ago and it was working fine. Recently, I made some changes to the Docker Compose file, such as adding GPU passthrough. After making these changes, I ran docker compose up, but it fails to use the existing data. Instead, it creates a new volume and starts fresh, ignoring my existing volume and data.
I can manually access the data through a file explorer, but I need the program running in the same container to execute that data for it to be useful. In short, I need to get the same Windows 10 installation to boot up instead of starting fresh.
Dockerfile:
FROM scratch COPY --from=qemux/qemu-docker:5.16 / /
ARG VERSION_ARG="0.0" ARG DEBCONF_NOWARNINGS="yes" ARG DEBIAN_FRONTEND="noninteractive" ARG DEBCONF_NONINTERACTIVE_SEEN="true"
RUN set -eu &&
apt-get update &&
apt-get --no-install-recommends -y install
bc
curl
7zip
wsdd
samba
xz-utils
wimtools
dos2unix
cabextract
genisoimage
libxml2-utils &&
apt-get clean &&
echo "$VERSION_ARG" > /run/version &&
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --chmod=755 ./src /run/ COPY --chmod=755 ./assets /run/assets
ADD --chmod=755 https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.py /usr/sbin/wsdd ADD --chmod=664 https://github.com/qemus/virtiso/releases/download/v0.1.248/virtio-win-0.1.248.tar.xz /drivers.txz
EXPOSE 8006 3389 VOLUME /storage
ENV RAM_SIZE "4G" ENV CPU_CORES "2" ENV DISK_SIZE "64G" ENV VERSION "win11"
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]
Docker compose
version: '3.7'
services: windows10: build: . container_name: windows10-container devices: - /dev/kvm - /dev/dri/temp_card0:/dev/dri/card0 - /dev/dri/renderD128 cap_add: - NET_ADMIN ports: - "8006:8006" - "3389:3389/tcp" - "3389:3389/udp" volumes: - "windows10_data:/mnt/data" - "/root/docker/windows10/shared:/shared" environment: - MANUAL=Y - RAM_SIZE=12G - CPU_CORES=8 - VERSION=win10 networks: - default stop_grace_period: 2m
volumes: windows10_data: external: true name: <existing_volume_name>
networks: default: driver: bridge
Docker log
root@windows10:~/docker/windows10# docker logs windows10-container ❯ Starting Windows for Docker v0.0... ❯ For support visit https://github.com/dockur/windows ❯ CPU: 13th Gen Intel Core TM i5 1340P | RAM: 50/63 GB | DISK: 70 GB (ext4) | HOST: 6.8.8-2-pve...
❯ Requesting Windows 10 from Microsoft server... ❯ ERROR: Failed to contact Microsoft servers! Is there an Internet connection or is the server down? ❯ Failed to download Windows 10, will try a diferent method now... ❯ Downloading product information from Microsoft server... ❯ Downloading Windows 10...
0K ........ ........ ........ ........ 0% 63.3M 62s
32768K ........ ........ ........ ........ 1% 62.1M 62s 65536K ........ ........ ........ ........ 2% 62.1M 62s 98304K ........ ........ ........ ........ 3% 62.1M 62s 131072K ........ ........ ........ ........ 4% 62.2M 61s 163840K ........ ........ ........ ........ 4% 62.2M 61s 196608K ........ ........ ........ ........ 5% 61.6M 60s 229376K ........ ........ ........ ........ 6% 62.1M 60s 262144K ........ ........ ........ ........ 7% 62.1M 59s 294912K ........ ........ ........ ........ 8% 62.1M 59s 327680K ........ ........ ........ ........ 8% 60.5M 58s 360448K ........ ........ ........ ........ 9% 62.2M 58s 393216K ........ ........ ........ ........ 10% 60.5M 57s 425984K ........ ........ ........ ........ 11% 62.2M 57s 458752K ........ ........ ........ ........ 12% 62.2M 56s 491520K ........ ........ ........ ........ 12% 62.1M 56s 524288K ........ ........ ........ ........ 13% 60.5M 55s 557056K ........ ........ ........ ........ 14% 62.1M 55s 589824K ........ ........ ........ ........ 15% 62.1M 54s 622592K ........ ........ ........ ........ 16% 60.5M 54s 655360K ........ ........ ........ ........ 16% 62.1M 53s 688128K ........ ........ ........ ........ 17% 60.5M 53s 720896K ........ ........ ........ ........ 18% 62.2M 52s
root@windows10:~/docker/windows10# docker compose up -d
WARN[0000] /root/docker/windows10/compose.yml: version is obsolete
[+] Running 2/2
✔ Network windows10_default Created 0.1s
✔ Container windows10-container Started 0.6s
root@windows10:~/docker/windows10# docker exec -it windows10-container /bin/bash
cd /mnt/data
ls -l # Ensure the necessary files like data.img are present
root@bf99da84020f:/# ls -l
total 9180
lrwxrwxrwx 1 root root 7 Jun 12 00:00 bin -> usr/bin
drwxr-xr-x 2 root root 4096 May 3 16:15 boot
drwxr-xr-x 6 root root 380 Jul 22 20:21 dev
-rw-rw-r-- 1 root root 9332884 May 29 21:09 drivers.txz
drwxr-xr-x 1 root root 4096 Jul 22 20:21 etc
drwxr-xr-x 2 root root 4096 May 3 16:15 home
lrwxrwxrwx 1 root root 7 Jun 12 00:00 lib -> usr/lib
lrwxrwxrwx 1 root root 9 Jun 12 00:00 lib64 -> usr/lib64
drwxr-xr-x 2 root root 4096 Jun 12 00:00 media
drwxr-xr-x 1 root root 4096 Jul 22 20:21 mnt
drwxr-xr-x 2 root root 4096 Jun 12 00:00 opt
dr-xr-xr-x 1284 root root 0 Jul 22 20:21 proc
drwx------ 1 root root 4096 Jun 14 02:40 root
drwxr-xr-x 1 root root 4096 Jul 22 20:21 run
lrwxrwxrwx 1 root root 8 Jun 12 00:00 sbin -> usr/sbin
drwxrwxrwx 2 root root 4096 Jul 11 14:45 shared
drwxr-xr-x 2 root root 4096 Jun 12 00:00 srv
drwxr-xr-x 3 root root 4096 Jul 22 20:21 storage
dr-xr-xr-x 13 root root 0 Jul 22 20:21 sys
drwxrwxrwt 1 root root 4096 Jul 11 14:43 tmp
drwxr-xr-x 1 root root 4096 Jun 12 00:00 usr
drwxr-xr-x 1 root root 4096 Jun 14 02:40 var
root@bf99da84020f:/# exit
exit
-bash: cd: /mnt/data: No such file or directory
total 52
-rw-r--r-- 1 root root 1034 Jul 23 01:41 Dockerfile
-rw-r--r-- 1 root root 1034 Jul 23 01:30 Dockerfile.bk
drwxr-xr-x 2 root root 4096 Jul 11 20:11 assets
-rw-r--r-- 1 root root 1164 Jul 23 01:41 compose.yml
-rw-r--r-- 1 root root 873 Jul 23 01:30 compose.yml.bk
-rw-r--r-- 1 root root 1431 Jul 11 20:11 kubernetes.yml
-rw-r--r-- 1 root root 1036 Jul 11 20:11 license.md
-rw-r--r-- 1 root root 14146 Jul 11 20:11 readme.md
drwxrwxrwx 2 root root 4096 Jul 11 20:15 shared
drwxr-xr-x 2 root root 4096 Jul 11 20:11 src
root@windows10:~/docker/windows10# docker volume ls DRIVER VOLUME NAME local 4c8ab9ed9f443c96e98d0bb247507f5636add20d3679a8e74549cfbe7312e3fc local 7c50fb1e32a72a8a8de096b2879c67e5859de24738e77853bb4daf3571ee8050 local 430bfbce9c0241c487b226a39896f94f10e911ab27f6e3449b8db4da48b20733 local 54044ec3e3dcd4ecbdb1a924d13a04034598960f43eac09da97b222a29f4d2ab local portainer_data root@windows10:~/docker/windows10#
"7c50fb1e32a72a8a8de096b2879c67e5859de24738e77853bb4daf3571ee8050" is the volume that has existing data
Could someone please help me understand why the existing volume is not being used and how I can resolve this issue?
Thank you for your assistance!
Screenshots (optional)
No response
you specified a path to data wrongly, need to specify like that: /home/usrname/composer/data:/storage