CS FundamentalsVery hardProduct-company DevOps interview
A Dockerfile ends with ENTRYPOINT ["python", "app.py"] and CMD ["--port", "80"]. The container is started with docker run myimg --port 9000. What command runs inside the container?
- A. python app.py --port 80
- B. --port 9000
- C. python app.py --port 80 --port 9000
- D. python app.py --port 9000
Correct answer: D. python app.py --port 9000
With exec-form ENTRYPOINT, CMD only supplies default arguments; arguments given to docker run replace CMD and are appended to ENTRYPOINT. Overriding the entrypoint itself needs --entrypoint.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A Go service's Docker image is 900 MB because it includes the compiler and build tools. Which change gives a small image containing only…
- An engineer runs docker exec into a running container, edits a config file, and later the container is removed and recreated from the same…
- A pipeline builds the application separately for each environment (dev, QA, prod) from the same commit. Which principle does this break…
- According to the Twelve-Factor App methodology, where should a service keep its database URL and API keys that differ between staging and…
- A CI pipeline takes 40 minutes: end-to-end UI tests (30 min) run first, then unit tests (3 min), then linting (1 min). Most failures are…
- A service's SLO is 99.9% of requests succeeding over a 30-day window. For a downtime-based view, what is the monthly error budget in…