Skip to content

Parametrization of TMP_DIR needed? #329

@comradefuzz

Description

@comradefuzz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions