New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[馃悰 Bug ]: Device data reset when docker restart #395
Comments
I also tried to mount volumes in this way but without success:
|
Having the same issue here. Tried it with privileged: true and the same volumes as @sandyboxy. |
I solved by mounting the following volumes:
Hope this helps! |
Thanks! @sandyboxy version: '3.3' services: volumes: |
I tried restarting with the same config file, but observed in
|
have same problem with @llai-utexas. Did you find a way? |
@ErcinDedeoglu I realize restarting the same docker container was the wrong way to keep the state. I follwed this suggestion here #129 (comment)
So what I did was using the volume mount confirguration listed above, but with a fresh docker container, while making sure the emulator was turned off in the last container, and the state was persisted |
@llai-utexas thanks a lot for your quick reply. It sounds like a lot of procedures to run for a docker container. I think this would be a maintenance failure for me. :) |
@ErcinDedeoglu I saw that comment as well. I had the pro version as well. While I would not run into the sudo issue, the emulator would not boot up properly (I think sudo privilege for pro version literally means just that, it doesn't mean |
I have managed to get the restart to work and persist the information. To do this I have created a Dockerfile that overwrites the original and restores the root user. I leave you the Dockerfile and docker-compose.yaml used in case it helps anyone. Dockerfile FROM budtmo/docker-android:emulator_11.0
USER root
RUN echo 'root:x:0:0:root:/root:/bin/bash' >> /etc/passwd
USER androidusr docker-compose.yaml version: '3.7'
services:
android-container:
image: budtmo/docker-android:emulator_11.0
build:
context: .
container_name: android-container
privileged: true
environment:
- EMULATOR_DEVICE=Samsung Galaxy S10
- WEB_VNC=true
volumes:
- data:/home/androidusr
- root:/root
ports:
- "6080:6080"
devices:
- "/dev/kvm:/dev/kvm"
restart: always
volumes:
data:
root: |
After a few days working with this image, I have continued to face some problems, they are now being fixed. Dockerfile FROM budtmo/docker-android:emulator_11.0
USER root
RUN echo 'root:x:0:0:root:/root:/bin/bash' >> /etc/passwd
USER androidusr
COPY run.sh /run.sh
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/run.sh"] run.sh #!/bin/bash
rm -rf /home/androidusr/emulator/*.lock
/home/androidusr/docker-android/mixins/scripts/run.sh docker-compose.yaml version: '3.7'
services:
android-container:
build:
context: .
container_name: android-container
privileged: true
environment:
- EMULATOR_DEVICE=Samsung Galaxy S10
- WEB_VNC=true
- WEB_LOG=true
- WEB_LOG_PORT=9000
- VNC_PASSWORD=yRBLPq4h5bVAzDT83f6jQX
- ENV_LOG_PATH=/var/log/
volumes:
- data:/home/androidusr
- root:/root
ports:
- "6080:6080"
- "9005:9000"
devices:
- "/dev/kvm:/dev/kvm"
restart: always
volumes:
data:
root: |
Operating System
Ubuntu 22.04
Docker Image
budtmo/docker-android:emulator_13.0
Expected behaviour
Hello,
this is my docker-compose based on @SudhanvaManjunath post
Actual behaviour
When I stop docker and restart it I have a new phone with default settings and without my previous settings and data.
The text was updated successfully, but these errors were encountered: