how to link tomcat container to mysql database container? The 2019 Stack Overflow Developer...

Are spiders unable to hurt humans, especially very small spiders?

Worn-tile Scrabble

How do you keep chess fun when your opponent constantly beats you?

Falsification in Math vs Science

Is it a good practice to use a static variable in a Test Class and use that in the actual class instead of Test.isRunningTest()?

How to notate time signature switching consistently every measure

The phrase "to the numbers born"?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

A word that means fill it to the required quantity

What is this sharp, curved notch on my knife for?

Finding the area between two curves with Integrate

Does HR tell a hiring manager about salary negotiations?

Dropping list elements from nested list after evaluation

Correct punctuation for showing a character's confusion

Can there be female White Walkers?

How to obtain a position of last non-zero element

Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?

How can I define good in a religion that claims no moral authority?

Unitary representations of finite groups over finite fields

What do I do when my TA workload is more than expected?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

The difference between dialogue marks

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Match Roman Numerals



how to link tomcat container to mysql database container?



The 2019 Stack Overflow Developer Survey Results Are InCan't login to MySQL database through terminalCreating mysql database for DrupalMySQL database across multiple serversStrange error from Easy Tomcat 7 connecting to MySQL databaseCannot start MySQL from a custom built MySQL image in a Docker container on a remote host onlyHow do I create a mysql client docker container that executes a mysql script against another mysql server container?Arch+KDE, connect to MySQL server in local container?Unable to connect to mysql running in docker container inside rhel host from windows machineJenkins: Using multiple docker containers to build and deploy an applicationAddressing Containerized haproxy instances in an active/passive configuration using corosync/pacemaker?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have built a tomcat image using the following dockerfile



FROM tomcat
COPY data-core.war /usr/local/tomcat/webapps/


then I built it using



docker build --no-cache -t tomcat:war .


Now how do I link a container based off this image with another container having mysql installed in it.Iam not really sure how the tomcat container can interact with the mysql database container.

Then finally i want to deploy/overlay this using kubernetes using the following yaml files for deployment and service.



1) deployment.yaml



apiVersion: apps/v1
kind: Deployment
metadata:
name: tomcat-deployment
labels:
app: tomcat
spec:
replicas: 1
selector:
matchLabels:
app: tomcat
template:
metadata:
labels:
app: tomcat
spec:
containers:
- name: tomcat
image: <REGISTRY>/<IMAGE>:<TAG>
ports:
- containerPort: 8080


2) service.yaml



kind: Service
apiVersion: v1
metadata:
name: tomcat-service
spec:
selector:
app: tomcat
ports:
- protocol: TCP
port: 80
targetPort: 8080









share|improve this question





























    0















    I have built a tomcat image using the following dockerfile



    FROM tomcat
    COPY data-core.war /usr/local/tomcat/webapps/


    then I built it using



    docker build --no-cache -t tomcat:war .


    Now how do I link a container based off this image with another container having mysql installed in it.Iam not really sure how the tomcat container can interact with the mysql database container.

    Then finally i want to deploy/overlay this using kubernetes using the following yaml files for deployment and service.



    1) deployment.yaml



    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: tomcat-deployment
    labels:
    app: tomcat
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: tomcat
    template:
    metadata:
    labels:
    app: tomcat
    spec:
    containers:
    - name: tomcat
    image: <REGISTRY>/<IMAGE>:<TAG>
    ports:
    - containerPort: 8080


    2) service.yaml



    kind: Service
    apiVersion: v1
    metadata:
    name: tomcat-service
    spec:
    selector:
    app: tomcat
    ports:
    - protocol: TCP
    port: 80
    targetPort: 8080









    share|improve this question

























      0












      0








      0








      I have built a tomcat image using the following dockerfile



      FROM tomcat
      COPY data-core.war /usr/local/tomcat/webapps/


      then I built it using



      docker build --no-cache -t tomcat:war .


      Now how do I link a container based off this image with another container having mysql installed in it.Iam not really sure how the tomcat container can interact with the mysql database container.

      Then finally i want to deploy/overlay this using kubernetes using the following yaml files for deployment and service.



      1) deployment.yaml



      apiVersion: apps/v1
      kind: Deployment
      metadata:
      name: tomcat-deployment
      labels:
      app: tomcat
      spec:
      replicas: 1
      selector:
      matchLabels:
      app: tomcat
      template:
      metadata:
      labels:
      app: tomcat
      spec:
      containers:
      - name: tomcat
      image: <REGISTRY>/<IMAGE>:<TAG>
      ports:
      - containerPort: 8080


      2) service.yaml



      kind: Service
      apiVersion: v1
      metadata:
      name: tomcat-service
      spec:
      selector:
      app: tomcat
      ports:
      - protocol: TCP
      port: 80
      targetPort: 8080









      share|improve this question














      I have built a tomcat image using the following dockerfile



      FROM tomcat
      COPY data-core.war /usr/local/tomcat/webapps/


      then I built it using



      docker build --no-cache -t tomcat:war .


      Now how do I link a container based off this image with another container having mysql installed in it.Iam not really sure how the tomcat container can interact with the mysql database container.

      Then finally i want to deploy/overlay this using kubernetes using the following yaml files for deployment and service.



      1) deployment.yaml



      apiVersion: apps/v1
      kind: Deployment
      metadata:
      name: tomcat-deployment
      labels:
      app: tomcat
      spec:
      replicas: 1
      selector:
      matchLabels:
      app: tomcat
      template:
      metadata:
      labels:
      app: tomcat
      spec:
      containers:
      - name: tomcat
      image: <REGISTRY>/<IMAGE>:<TAG>
      ports:
      - containerPort: 8080


      2) service.yaml



      kind: Service
      apiVersion: v1
      metadata:
      name: tomcat-service
      spec:
      selector:
      app: tomcat
      ports:
      - protocol: TCP
      port: 80
      targetPort: 8080






      linux ubuntu mysql docker






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Vignesh SwaminathanVignesh Swaminathan

      1




      1






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1423775%2fhow-to-link-tomcat-container-to-mysql-database-container%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1423775%2fhow-to-link-tomcat-container-to-mysql-database-container%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...