Hot answers tagged

7

1) How can I run several different branches on the staging server? Docker 2) How would I set up the DB evolution system to make sure it always has appropriate DB for each branch? This depends on how much you expect your DB to scale. You can get pretty crazy with methods to clone database data but typically you will want a master copy that you do not ...


3

You can run the container in detached mode by passing -d or --detach with the run command: https://docs.docker.com/engine/reference/run/#detached-vs-foreground


3

Since the response is Access denied for user so the port and the ip address is correct. I guess the only issue as @James said will be in the permission, you have to allow root access to mysql from elk and php containers, you can do it in easy way but it's not secure: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; %: mean match all ...


2

I'd argue that this isn't actually about staging servers. A staging server closely mimics the production environment, and is where a release goes immediately prior to going to production. A feature branch that hasn't been merged into master is not going to be released directly to production, so it should not go on a staging server. If we reframe the ...


2

On top of protecting your root account as best as you can, you should be able to reduce the risk of such resource deletion if you have more than 1 resource to protect. For example if all AWS resources you had to protect were 2 RDS database servers, you could create 2 other accounts that have access to only copy the snapshots of one of your database servers ...


2

I would suggest to only run stateless apps in k8s. One should run statefull apps like databases in dedicated database solutions like AWS RDS.


2

That's a known issue .. since image layers are built using containers, data saved to folders does not make it to the next layer or your final container Removing intermediate container b3ff83bbf273 If you want data to persist between updated containers you have to manually map data to the host outside the container-specific mount points. For example, when ...


2

Your golang api should be included in the compose file and added to the same network. It also looks like when you run the golang api that you are adding it to a network other than backend, which is the network that is created in your compose file.


2

What would be the best way to share ports among the containers? You don't really "share" ports between containers. Instead, you want to create network and attach each container to that network. Each container gets a network alias (essentially a hostname) that you can use to hit the service. $ docker network create foo $ docker run --network=foo --...


2

As the documentation clearly states docker run command should be invoked as follows: docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...] so when you run docker run mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password Docker assumes -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password is a command you want to run inside the container, not a list of options ...


2

At first, I misread your question, thinking you wanted to run more than one service together, so I had recommended Docker Compose which makes it easy to run multiple services together, with networking, and can even specify the start up order. But now I see you are just trying to run MySQL, and wondering do you need separate containers for the OS and MySQL: ...


1

The default Dockerfile shell is sh. I don't think echo there has the -e modifier for backslash. Newline & other special symbols will work by default. In your command, resulting .my.cnf would contain a litteral -e. Remove -e or use the original command in Dockerfile in a different shell, for instance: RUN /bin/bash -c '<your-command>'


1

I actually found the solution here: https://stackoverflow.com/a/64150016/1526406 Maybe this helps others as well.


1

Have you thought about what happen with stale/old data?? Each new version creates a ton of new entries. Management becomes a nightmare the DB becomes a SPOF(single point of failure). Better Solution: Service discovery The better solution would be to use a Service discovery System and annote each Service with their version and the environment as a Metadata ...


1

I have a little script for my MariaDb database inside a docker container. The setup is comparable. I have a database container with a mounted volume. Furthermore I have a second volume for backups mounted under /backup. The script is run on the host via cron and uses the database instance inside the container, so only one database accesses the data. That is ...


1

One way to achieve this is by using the MySQL socket to connect instead of port. For this you would have bind a mount to your container. You would anyway need a host directory bound to container to persist Database data. First create a directory on host to mount container /var/lib/mysql Use -v option in docker run to attach host path to container Connect ...


1

Solution: root $ root $ mysql -h localhost -P 3306 --protocol=tcp -u user -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 17 Server version: 8.0.21 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle ...


1

There shouldn't be any reason why you can't. I think that the issue would be in getting the memory management correct on the host. The orchestration would be the same. Here's some resources: https://dev.mysql.com/doc/mysql-cluster-excerpt/8.0/en/faqs-mysql-cluster.html#qandaitem-B-1-13 https://www.digitalocean.com/community/tutorials/how-to-create-a-...


1

Does the following work? docker-compose exec mariadb /usr/bin/mysql -u <your_db_username> --password=<your_db_password> < your_db_backup.sql Note: mariadb is the name of your container. Edit: I realize I'm using docker-compose. So I'm not entirely sure if this would work with just a Dockerfile.


1

In addition to connecting app container with same backend network, you will also need to fix MySQL host parameter in connection string. Looking at main function you have MySQL host set to localhost serverName := "localhost:3306" However, MySQL is not listening at lcoalhost of appc container you will need to change it to MySQL service name in compose file, ...


1

Without seeing the specific error it looks like the container's runtime process is either crashing or exiting. When a docker container's runtime process exits the container stops. You can get more information about the specific error by using the docker logs command: docker logs 92455a993a54


1

Pulling the images only make them available for you to use locally. Therefore, to use them within a container you should run the command docker run with the appropriate configuration for each services


1

I think you could achieve something similar by first running Terraform against your RDS resources, and then running Terraform again on all resources. On your first pass, you can use -target option to target only a subset of the resources. (ie. RDS resources). Be aware that using this option is not recommended in Terraform docs. If I were you, I would use ...


1

First, confirm that the container is actually listening for connections and has properly bound to the interface. If not, you probably need to fix the bind-address= and/or port= directives in your my.cnf. Otherwise, you probably have an issue with your GRANTs. Check that the IP/subnet is correctly authorized in the mysql.user table with the command select ...


1

That is what gitlab does best, consider to move to gitlab, setup a kube cluster and auto deploy. This will deploy each branch to an unique URL for testing.


Only top voted, non community-wiki answers of a minimum length are eligible