Code Monkey home page Code Monkey logo

task's Introduction

Task 1

Write a Dockerfile (CentOS 6) to install the following in a Docker continer:

Python 2.7 MongoDB - any version Apache tomcat 7 - running on port 8080 Please include comments at every command explaining what it does. Write the command to run the Dockerfile such that once the container boots, apache tomcat's home page is accessible from the host on port 7080. Contents

This directory is the build context for the docker image containing Python 2.7, MongoDB 3.4 and Apache Tomcat 7.

'mongodb-org-3.4.repo' file is required for configuring the yum repository to download MongoDB 3.4 'start.sh' scriptis required to ensure both MongoDB and Tomcat servers run simultaneouly 'Dockerfile' to build docker image Requirements:

Docker >= 17 Instructions:

After cloning the repo execute the following commands -

Task-1 To build the docker image,

docker build -t mytomcat . (don't forget the dot at the end, it implies current directory) To run a docker container with the built docker image,

docker run -p 7080:8080 -p 27017:27017 -d --name mytomcatcontainer mytomcat Optionally, you may attach/ connect to the docker instance using,

docker exec -it mytomcatcontainer /bin/bash Now Tomcat server and MongoDB server are accessible from the host on port '7080' and '27017' respectively.

NOTE:-

Python 2.7 interpreter is accessible from within the container as 'python2.7'. Invoking 'python' will bring up Python 2.6 interpreter. Ex: $ python2.7 --version Python Python 2.7

$ python --version Python 2.6.6 All files in this directory should be included in the build context for docker image build to succeed.

task's People

Contributors

krish4455 avatar

Watchers

James Cloos avatar Kumar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.