Nitin Agrawal
Contact -
  • Home
  • Interviews
    • Secret Receipe
    • InterviewFacts
    • Resume Thoughts
    • Daily Coding Problems
    • BigShyft
    • CompanyInterviews >
      • InvestmentBanks >
        • ECS
        • Bank Of America
        • WesternUnion
        • WellsFargo
      • ProductBasedCompanies >
        • CA Technologies
        • Model N India
        • Verizon Media
        • Oracle & GoJek
        • IVY Computec
        • Nvidia
        • ClearWaterAnalytics
        • ADP
        • ServiceNow
        • Pubmatic
        • Expedia
        • Amphora
        • CDK Global
        • CDK Global
        • Epic
        • Sincro-Pune
        • Whiz.AI
        • ChargePoint
      • ServiceBasedCompanies >
        • Altimetrik
        • ASG World Wide Pvt Ltd
        • Paraxel International & Pramati Technologies Pvt Ltd
        • MitraTech
        • Intelizest Coding Round
        • EPAM
    • Interviews Theory
  • Programming Languages
    • Java Script >
      • Tutorials
      • Code Snippets
    • Reactive Programming >
      • Code Snippets
    • R
    • DataStructures >
      • LeetCode Problems
      • AnagramsSet
    • Core Java >
      • Codility
      • Program Arguments OR VM arguments & Environment variables
      • Java Releases
      • Threading >
        • ThreadsOrder
        • ProducerConsumer
        • Finalizer
        • RaceCondition
        • Executors
        • Future Or CompletableFuture
      • Important Points
      • Immutability
      • Dictionary
      • URL Validator
    • Julia
    • Python >
      • Decorators
      • String Formatting
      • Generators_Threads
      • JustLikeThat
    • Go >
      • Tutorial
      • CodeSnippet
      • Go Routine_Channel
      • Suggestions
    • Methodologies & Design Patterns >
      • Design Principles
      • Design Patterns >
        • TemplatePattern
        • Adapter Design Pattern
        • Decorator
        • Proxy
        • Lazy Initialization
        • CombinatorPattern
        • RequestChaining
        • Singleton >
          • Singletons
  • Frameworks
    • Apache Velocity
    • Spring >
      • Spring Boot >
        • CustomProperties
        • ExceptionHandling
        • Issues
      • Quick View
    • Rest WebServices >
      • Interviews
      • Swagger
    • Cloudera BigData >
      • Ques_Ans
      • Hive
      • Apache Spark >
        • ApacheSpark Installation
        • SparkCode
        • Sample1
        • DataFrames
        • RDDs
        • SparkStreaming
        • SparkFiles
    • Integration >
      • Apache Camel
    • Testing Frameworks >
      • JUnit >
        • JUnit Runners
      • EasyMock
      • Mockito >
        • Page 2
      • TestNG
      • Gatling
    • Blockchain >
      • Ethereum Smart Contract
      • Blockchain Java Example
    • Microservices >
      • Messaging Formats
      • Design Patterns
    • AWS >
      • Honeycode
    • Dockers >
      • GitBash
      • Issues
  • Databases
    • MySql
    • Oracle >
      • Interview1
      • SQL Queries
    • Elastic Search
  • Random issues
    • TOAD issue
    • Architect's suggestions
  • Your Views

Forgot port for MongoDB after start

8/10/2022

0 Comments

 
You started MongoDB container but forgot on which node it is runing currently.
To get the port information, you can use below command on GitBash to get the information-
docker logs 2239bc0d7a0e | grep 'port'
Picture
Or you can get into Container's file system by-
$ winpty docker exec -it 2239bc0d7a0e sh
# cd bin
# service mongod status

And here you can see the port number.
0 Comments

Installing Docker on Windows

8/10/2022

0 Comments

 
When trying to install Docker on Windows, it gives the error either about Windows version or
may be you need to have WSL enable on your Windows version.
Sometimes WSL seems complicated. So better, install Docker Toolbox to have use Docker on
your Windows withtout other changes.
Check below URL-
​Install Docker Toolbox in Windows (bitnami.com)
0 Comments

Using GitBash with Docker on Windows10

8/10/2022

0 Comments

 
Sometimes we need to use our own laptop to try something but sometimes due to system contraints we are blocked.
Here, we use below command to access the virtual filesystem on container on our office VMs-
$ docker exec -it <image name or id> /bin/bash
or
$ docker exec -it <image name or id> /bin/sh

But if try to use on Windows machine Command Prompt, we can't.
So we can try 'GitBash', but again it is not a complete Linux terminal also, so if try any of the
​above commands we see below error-

Picture
So you try winpty in place of bin/bash but that also doesn't work.
But interestingly we can execute other docker command like-
docker run
docker start
docker images etc..
But we want to get into the file system, so for that we need to use winpty like -
winpty docker exec -it <image id or name> sh
or
winpty docker exec -it <image id or name> bash
But the only difference I observed is that there will be different prompts & I currently know only
about these 2 options sh or bash
But again it is not complete Linux terminal so there will be limited Linux commands are
​available to use.

0 Comments

    Author

    Nitin Agrawal

    Archives

    August 2022

    Categories

    All

Powered by Create your own unique website with customizable templates.