How to expose mysql port while starting Mysql test container #26
              
                
                  
                  
                    Answered
                  
                  by
                    Koumudini-Sambre
                  
              
          
                  
                    
                      Koumudini-Sambre
                    
                  
                
                  asked this question in
                Q&A
              
            -
| Hi, is there any provision to expose a specific port while mysql container is starting? I need to use these ports in other services which needs mysql. Can anyone please help me with that? Thanks in advance | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            Koumudini-Sambre
          
      
      
        Sep 6, 2023 
      
    
    Replies: 1 comment
-
| Hi, below is the way we can do this: container = Testcontainers::MysqlContainer.new(@image_name,  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        Koumudini-Sambre
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Hi, below is the way we can do this:
container = Testcontainers::MysqlContainer.new(@image_name,
name: @name,
port_bindings: {"3306/tcp" => "3306"})