1

I'm using the following docker image: https://github.com/budtmo/docker-android It's Docker image for Android emulators.

I'm run It using Kubernetes with the following deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: android-deployment
spec:
  selector:
    matchLabels:
      app: android-emulator
    replicas: 10
  template:
    metadata:
    labels:
        app: android-emulator
     spec:
       containers:
       - name: android-emulator
         image: budtmo/docker-android-x86-8.1
         ports:
         - containerPort: 6080
         - containerPort: 5554
         - containerPort: 5555
         env:
         - name: DEVICE
           value: "Samsung Galaxy S8"

After the container is running its automatic start the Android emulator (don't know exactly how). I need to run python script automatic after the container is up for each running container, How can I do it? What should I change in my deployment file?

1 Answer 1

2

You could simply create a Dockerfile to build your own image from the budtmo/docker-android-x86-8.1 base image and deploy this. Within the Dockerfile you define the start command or entrypoint.

UPDATE

I think I understand, correct me, if I am wrong: You want run your python script against the Android emulator running in Kubernetes.

As I said, I am not really firm with Kubernetes but couldn't you run the Android emulator as an init container, and the python script itself in the "main" container?

Like described here: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/

Sign up to request clarification or add additional context in comments.

4 Comments

When I'm create CMD was running my python the emulator isn't running
Okay I am not sure if I understand it correct as I am not so firm with kubernetes and not at all with your setting. Do I understand you right: you have to make sure, that there is an android emulator running first. before your python script but both things are running in the same docker container?
EXACTLY, is it possible?
I'm not sure how exactly to do it, but it IS possible. I suppose you have a look at the describtion here. I think it's a good starting point. kubernetes.io/docs/concepts/workloads/pods/init-containers Basically, I think what you need to have is a check, if the emulator is running. Maybe the docker container you use can give you this information. Otherwise you would have to write your own script to check this, like firing up some request against it, and if it fails, it means the container is not up yet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.