<p>Currently, the only option when your container doesn't have bash is to add it. With Alpine you can do that with <code>apk add bash</code>. You can do that with <a href="https://docs.gitlab.com/ee/ci/yaml/#before_script" rel="nofollow noreferrer"><code>before_script</code></a> like this,</p>
<pre class="lang-yaml prettyprint-override"><code>test:
  variables:
    SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
  before_script:
    - apk add bash
  script:
    - curl --silent &quot;https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer&quot; | bash
</code></pre>

CC BY-SA 4.0
2023-04-11T16:47:13.593Z
2023-04-11T16:47:13.593Z
Evan Carroll
<p>GitLab offers a <a href="https://docs.gitlab.com/ee/ci/secure_files/" rel="nofollow noreferrer">Project-level Secure Files</a>, the API has you add this to your <code>.gitlab-ci.yml</code>,</p>
<pre class="lang-yaml prettyprint-override"><code>test:
  variables:
    SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
  script:
    - curl --silent &quot;https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer&quot; | bash
</code></pre>
<p>However, I'm using the <a href="https://gitlab.com/gitlab-org/terraform-images/-/blob/master/Dockerfile" rel="nofollow noreferrer">Terraform image which is Alpine without bash</a> which the <a href="https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" rel="nofollow noreferrer">installer script requires</a>.</p>
<p>How can you use Secure File API if your container doesn't have bash?</p>

<gitlab><bash><alpine>
Can you use the Secure File API if the container doesn't have bash? Like Alpine?
Evan Carroll
# Can you use the Secure File API if the container doesn't have bash? Like Alpine?

(Asked by: username_0 on 2023-04-10)

GitLab offers a Project-level Secure Files, the API has you add this to your .gitlab-ci.yml,
test:
  variables:
    SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
  script:
    - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash

However, I'm using the Terraform image which is Alpine without bash which the installer script requires.
How can you use Secure File API if your container doesn't have bash?

**Tags:** gitlab, bash, alpine


---

## 1 answers

### Answer by username_0 on 2023-04-11. Score: 0 | Accepted answer

Currently, the only option when your container doesn't have bash is to add it. With Alpine you can do that with apk add bash. You can do that with before_script like this,
test:
  variables:
    SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
  before_script:
    - apk add bash
  script:
    - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash


---

