How to implement a custom docker image from the circleCI/android, for use in development, testing and CI

Salut, I’m CI beginner and I’m trying to set up a Dockerfile and docker-compose from the circleCI/android image for create a custom docker image, for use in development, I mean that before, I’ve created a custom image in docker to develop with react for example, I can connect the port of the container with a port of my pc and see the project running in the browser, how can I do the same for an android project, I would like to see the changes that are made in an android project in an emulator. I want to have all the necessary tools to develop with android like the sdk in a image, and share this image with my team for everyone to work on the same image in docker and “see” the changes as I do for web projects.

A simple example for a Dockerfile web

FROM node:alpine
COPY ["package.json", "yarn.lock", "/usr/src/app/"]
WORKDIR /usr/src/app
RUN yarn install
COPY [".", "/usr/src/app"]
EXPOSE 3000
CMD ["yarn", "start"]

A simple example for a docker-compose web

version: "3"
services:
  react:
    container_name: react-dev
    build:
      context: .
      dockerfile: build/Dockerfile
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - 3000:3000
      - 9229:9229
    command: yarn start
    environment:
      - NODE_ENV=development
      - CHOKIDAR_USEPOLLING=true

In this way I can see the changes in development reflected in my browser. How I can do this in a android project, I would like to see the changes reflected in my emulator for example. I think it would be something like that:

FROM circleci/android:api-23
###
# code
###

How would the dockerfile and docker-compose be for this type of project. I posted this on Stack Overflow, and didn’t get an answer. Here is the link

1 Like

Cross-posted without declaration here: https://stackoverflow.com/questions/57302127/how-to-implement-the-circleci-android-image-for-a-development-environment-by-con

How can I declare cross-posted?

You can say something like:

I posted this on Stack Overflow, and didn’t get an answer, so I’m trying here. Here is the link.

Then you can go to your Stack Overflow question and edit it, and put this at the end:

Update

I have also posted this on the CircleCI forum.

That way, if someone finds your question in the future, they can explore your duplicates before spending time crafting an answer. If they find it is answered not in the place they are at, but it is answered elsewhere, it will save them wasting their time.

The question has been marked as “Too Broad” on Stack Overflow, and I’d say the same applies here, even if it cannot be marked as such. The main difficulties here are:

  • readers don’t know what problem you are trying to solve (are you trying to connect to a virtual device or a real one? If the latter, how do you plan to connect to it in a CI environment? Are you running tests? If so, what test framework are you using? Do you have an app to test? What language? etc)
  • there does not seem to be any research
  • there does not seem to be any practical attempt

If you can narrow down the problem, that is excellent. You can do this even if you are a CI or CircleCI beginner. Use a search engine thoroughly; do fifty good searches, not one.

You added some good comments under your Stack Overflow question - so edit the question to include that information. Don’t wait to be asked for clarifications - add it into your first edit.

Thanks. I hope I have done better now.