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

Parametrization of TMP_DIR needed? #329

Closed
comradefuzz opened this issue Mar 12, 2018 · 4 comments
Closed

Parametrization of TMP_DIR needed? #329

comradefuzz opened this issue Mar 12, 2018 · 4 comments

Comments

@comradefuzz
Copy link

comradefuzz commented Mar 12, 2018

I had problems with my CI integration. When dgoss runs my container it cannot access to mounted directory files.

I have this CI configuration:

image: docker:latest

services:
  - docker:dind
test:
  stage: test
  script:
    - apk add bash curl --no-cache
    - curl -fsSL https://goss.rocks/install | sh
    - docker pull "$CI_REGISTRY_IMAGE"
    - dgoss run "$CI_REGISTRY_IMAGE"

dgoss fails with output:

INFO: Starting docker container
INFO: Container ID: bbba20c7
INFO: Sleeping for 0.2
INFO: Running Tests
sh: /goss/goss: not found
ERROR: Job failed: exit code 127

Some painful debugging shown that directory mounted as /goss to container with goss binary file is empty while source temporary directory on host /tmp/tmp.XXXXXXXXXX contains correct files.
I put some patches in dgoss script that make temporary directory appear in CWD and problem seems to be fixed. I suppose that mounted directory in gitlab pipelines environment in /tmp is inaccessible in container context.

I suggest you can simply parametrize location of $tmp_dir to fix this issue.

@iWader
Copy link

iWader commented Mar 19, 2018

Also having this problem on CircleCI

Edit: Found a solution. dgoss uses GOSS_FILES_STRATEGY to either mount or copy the GOSS_FILES into the container. Changing this to copy solved my issue.

export GOSS_FILES_STRATEGY=cp
dgoss run vendor/container

Related to #271 #305

@moschlar
Copy link

The problems with GOSS_FILES_STRATEGY=cp are actually due to the docker-in-docker mechanism.
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-executor has a bullet point on these issues.
But I think for dgoss, just using the mentioned workaround is sufficient.

@aelsabbahy
Copy link
Member

@comradefuzz feel free to create a pull request that allows overriding the tmp_dir location.

@aelsabbahy
Copy link
Member

I believe this is fixed with #684, feel free to let me know if it doesn't.

Thank you for submitting this feature request.

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

No branches or pull requests

4 participants