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

Paths to Dockerfile resources not updated, missing files, build issues #9

Closed
joshuaganger opened this issue Sep 4, 2019 · 6 comments
Assignees
Labels
🐛 bug Something isn't working 🎃 hacktoberfest https://hacktoberfest.digitalocean.com/details
Milestone

Comments

@joshuaganger
Copy link

make docker_all fails with:

writing new private key to 'docker/certs/osctrl.key'
docker/certs/osctrl.key: No such file or directory
140048378546064:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('docker/certs/osctrl.key','w')
140048378546064:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
make: *** [docker_all] Error 1

Attempting to manually start:

docker-compose up
...
ERROR: Cannot locate specified Dockerfile: docker/tls/Dockerfile

docker-compose.yml is now located inside the docker directory, it seems the path to the Dockerfile should be just tls/Dockerfile.

After editing paths, docker-compose up fails with:

ERROR: Service 'osctrl-tls' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder567593261/cmd/tls/scripts: no such file or directory

This appears to be because it's looking for the ~/osctrl/cmd/tls/scripts directory that is one directory up from the docker-compose.yml.

@javuto javuto added the 🐛 bug Something isn't working label Sep 8, 2019
@javuto javuto added this to the v0.1.7 milestone Sep 8, 2019
@javuto javuto self-assigned this Sep 8, 2019
@javuto
Copy link
Collaborator

javuto commented Sep 9, 2019

I just ran make docker_all and it worked without any issue. What OS and version of Docker are you running? I am in macOS 10.14.6 and Docker version 19.03.1, build 74b1e89.
So make docker_all uses the tool dockerize.sh with the following parameters:

$ ./docker/dockerize.sh -u -b -f

According to the help of dockerize.sh:

$ ./docker/dockerize.sh -h

Usage: ./docker/dockerize.sh -h [PARAMETER] [PARAMETER] ...

Parameters:
  -h	Shows this help message and exit.
  -b	Builds new docker containers.
  -u	Run osctrl containers.
  -c	Generates configuration files.
  -f	Forces the generation of new certificates and configuration.
  -m	Uses mkcert (https://github.com/FiloSottile/mkcert) to generate certificate.
  -d	Takes down running containers.
  -x	Removes container images.

What the command does is:
1 - Run the containers (-u)
2 - Build the containers (-b)
3 - Forces the generation of a new certificate (-f)

Lastly, unless you make sure all necessary files are in place, docker-compose will fail because there are certain configuration files that need to be prepared before launch the containers.

It seems like the command in your box is failing on the key generation step (https://github.com/jmpsec/osctrl/blob/master/docker/dockerize.sh#L151), do you have openssl installed in your machine?

@javuto javuto added question❓ Further information is requested and removed 🐛 bug Something isn't working labels Sep 9, 2019
@javuto javuto removed this from the v0.1.7 milestone Sep 16, 2019
@javuto
Copy link
Collaborator

javuto commented Sep 25, 2019

@joshuaganger feel free to reopen this issue if this is still a problem, thanks!

@javuto javuto closed this as completed Sep 25, 2019
@javuto javuto added 🐛 bug Something isn't working 🎃 hacktoberfest https://hacktoberfest.digitalocean.com/details and removed question❓ Further information is requested labels Oct 2, 2019
@javuto javuto added this to the v0.1.9 milestone Oct 2, 2019
@javuto javuto reopened this Oct 2, 2019
@javuto
Copy link
Collaborator

javuto commented Oct 2, 2019

Please test master now and see if this issue is resolved with the fix landed in #20. Don't forget to use make docker_all or the dockerize.sh utility. Thanks!

@javuto javuto closed this as completed Oct 2, 2019
@joshuaganger
Copy link
Author

I'm running CentOS 7.7, docker 19.03.2. From a new copy of master:

$ make docker_all
./docker/dockerize.sh -u -b -f
[+] Preparing certificates for osctrl-nginx
[+] Generating docker/certs/osctrl.key
Generating a 1024 bit RSA private key
..++++++
......++++++
writing new private key to 'docker/certs/osctrl.key'
docker/certs/osctrl.key: No such file or directory
140228694583184:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('docker/certs/osctrl.key','w')
140228694583184:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
make: *** [docker_all] Error 1

I don't currently see a docker/certs directory. If I create the docker/certs directory, it then errors on creating tls.conf in docker/config because that directory doesn't exist either. If I create docker/config it appears to work.

I suspect you have empty directories in your local repo that are being ignored by Git. You may want to look into a solution like this: https://steindom.com/articles/add-empty-directory-git-repository to bring the empty directories into your git repository. Just don't forget to update it if you ever add files to those directories that should be included in the repo.

@javuto javuto reopened this Oct 3, 2019
@javuto
Copy link
Collaborator

javuto commented Oct 3, 2019

Weird, I addressed that issue in #20 by making sure both docker/certs and docker/config were created. The only thing I can think of is that the mkdir command does not have the right permissions and it can not create them. Anyway, thanks for the tip about the empty directories, that is now in place so it should be fine 😄

@javuto javuto closed this as completed Oct 3, 2019
@lashomb
Copy link

lashomb commented Oct 8, 2019

this had happened to me as well, moving the docker-compose.yaml file out to the root of the repo fixed it for me.

CptOfEvilMinions added a commit that referenced this issue Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🎃 hacktoberfest https://hacktoberfest.digitalocean.com/details
Projects
None yet
Development

No branches or pull requests

3 participants