InterviewSolution
Saved Bookmarks
| 1. |
Develop your own custom test environment and publish it on the docker hub. |
|
Answer» Write instructions in a dockerfile.
docker build -t learn_docker dockerFiles/
docker run -it learn_docker
--Tag the local image as: <hub-user>/<repo-name>:[:<tag>]Examples: docker tag learn_docker divyabhushan/learn_docker:dev docker tag learn_docker divyabhushan/learn_docker:testing--list the images for this container: Divya1@Divya:~ $docker images REPOSITORY TAG IMAGE ID CREATED SIZE divyabhushan/learn_docker develop 944b0a5d82a9 About a minute ago 88.1MB learn_docker dev1.1 944b0a5d82a9 About a minute ago 88.1MB divyabhushan/learn_docker dev d3e93b033af2 16 MINUTES ago 88.1MB divyabhushan/learn_docker testing d3e93b033af2 16 minutes ago 88.1MB Push the docker images to docker hub docker push divyabhushan/learn_docker:dev docker push divyabhushan/learn_docker:develop docker push divyabhushan/learn_docker:testing The push REFERS to repository [docker.io/divyabhushan/ learn_docker] 53ea43c3bcf4: Pushed 4b7d93055d87: Pushed 663e8522d78b: Pushed 283fb404ea94: Pushed bebe7ce6215a: Pushed latest: digest: sha256:ba05e9e13111b0f85858f9a3f2d3dc0d6b743db78880270524e799142664ffc6 size: 1362
Summarize: Develop your application CODE and all other dependencies like the binaries, library files, downloadables required to run the application in the test environment. Bundle it all in a directory.
NOTE: This docker image has your application bundle = application code + dependencies + test run time environment exactly similar to your machine. Your application bundle is highly portable with no hassles. |
|