Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to exploit docker-compose default files #183

Closed
CharlesGodwin opened this issue Nov 25, 2020 · 3 comments · Fixed by #689 · May be fixed by #553
Closed

How to exploit docker-compose default files #183

CharlesGodwin opened this issue Nov 25, 2020 · 3 comments · Fixed by #689 · May be fixed by #553

Comments

@CharlesGodwin
Copy link

CharlesGodwin commented Nov 25, 2020

docker-compose opens several files by default as described here. These are the default docker-compose.yml file and a default override file named docker-compose.override.yml which acts as an override similar to the docker-override.yml file used in the repo.
docker-compose also opens, by default, an environment file named .env. Refer to this documentation.

These files are very useful for just-in-time override setting and the .env file allows you to define stack wide environment values.

However using these files in the default ~/IOTstack directory will cause git to identify the files for tracking. The solution is to tell git to ignore them. The technique I use is to create a file named .gitignore-iotstack in the directory and then tell git to use that as a configuration file for exclusion. This setup will not impact the default git settings for this repo.

Here's what to do:

  1. create a file named .gitignore-iotstackwith this content:
#
# Use the following command to set up extended exclude list for ./IOTstack
# git config core.excludesfile .gitignore-iotstack
#
.gitignore-iotstack
docker-compose.override.yml
.env
  1. run this git command git config core.excludesfile .gitignore-iotstack

That should do it. NOTE this does not take care of these files being backed up as defined in PR #183 but can be done now and dropped if the PR is merged.

@mats-nk
Copy link

mats-nk commented Nov 25, 2020

But all this is already there .gitignore and it contains compose-override.yml.

So rename your docker-compose.override.yml to compose-override.yml and everything will work out of the box.

@CharlesGodwin
Copy link
Author

compose-override.yml is a file specifically defined by IOTstack and is only used, in conjunction with menu.sh, to build docker-compose.yml. If you make changes to that file you must rerun menu.sh to build a new, merged, docker-compose.yml. docker-compose.override.yml is a file defined by docker-compose program as a default run time override file and no preprocessing of the file is required. The biggest differences are the run time override aspect of the file and the file is conformant with docker-compose run-time documentation.

.env is not in the current .gitignore.

@ukkopahis
Copy link

Problem files: docker-compose.override.yml and .env
#570 will include these into backups
#553 will add these to .gitignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants