title: Docker secret not mounting to default location
body: <p>I'm using docker-compose to produce a docker image which requires access to a secure Azure Artifacts directory via Paket. As I'm sure at least some people are aware, Paket does not have default compatibility with the Azure Artifacts Credential Provider. To gain the access I need, I'm trying to mount the access token produced by the credential provider as a secret, then consume it using <code>cat</code> within a <code>paket config</code> command. <code>cat</code> then returns an error message stating that the file is not found at the default secret location.</p>
  <p>I'm running this code within an Azure Pipeline on the Microsoft-provided <code>ubuntu-latest</code> agent.</p>
  <p>Here's the relevant code snippets (It's possible I'm going into too much detail...):</p>
  <p><code>docker-compose.ci.build.yml</code>:</p>
  <pre><code>version: '3.6'
  
  services:
    ci_build:
      build:
        context: .
        dockerfile: Dockerfile
      image: &lt;IMAGE IDENTITY&gt;
      secrets:
        - azure_credential
  
  secrets:
    azure_credential:
      file: ./credential.txt
  </code></pre>
  <p><code>dockerfile</code>:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/sdk:6.0.102-bullseye-slim-amd64 AS build
  &lt;LABEL maintainer=&quot;&lt;Engineering lead&gt;&quot;
  
  WORKDIR /src
  &lt;Various COPY instructions&gt;
  RUN dotnet tool restore
  RUN dotnet paket restore
  RUN --mount=type=secret,id=azure_credential dotnet paket config add-token &quot;&lt;ARTIFACT_FEED_URL&gt;&quot; &quot;$(cat /run/secrets/azure_credential)&quot;
  </code></pre>
  <p>Azure pipeline definition YAML:</p>
  <pre><code>jobs:
    - job: BuildPublish
      displayName: Build &amp; Publish
      steps:
        - task: PowerShell@2
          displayName: pwsh build.ps1
          inputs:
            filePath: ${{ parameters.workingDirectory }}/.azure-pipelines/build.ps1
            pwsh: true
            workingDirectory: ${{ parameters.workingDirectory }}
          env:
            SYSTEM_ACCESSTOKEN: $(System.AccessToken)
  </code></pre>
  <p>The relevant lines of the powershell script initiating docker-compose:</p>
  <pre><code>$projectRoot = Split-Path -Path $PSScriptRoot -Parent
  Push-Location -Path $projectRoot
  try {
      ...
      Out-File -FilePath ./credential.txt -InputObject $Env:SYSTEM_ACCESSTOKEN
      ...
      &amp; docker-compose -f ./docker-compose.ci.build.yml build
      ...
  }
  finally {
      ...
      Pop-Location
  }
  </code></pre>
  <p>The error message:
  <code>0.276 cat: /run/secrets/azure_credential: No such file or directory</code></p>
  <p>If there's other relevant code, let me know.</p>
  <p>I tried to verify that the environment variable I'm housing the secret in on the agent even existed and that the value was being saved to the <code>./credential.txt</code> file for mounting in the image. I verified that the text file was being properly created. I've tried fiddling with the syntax for all the relevant commands--fun fact, Docker docs have two different versions of the mounting syntax, but the other version just crashed. I tried using Windows default pathing in case my source image was a Windows one, but it doesn't appear to be.</p>
  <p>Essentially, here's where I've left it: I know that the file <code>./credential.txt</code> exists and contains some value. I know my mounting syntax is correct, or Docker would crash. The issue appears to be something to do with the default mounting path and/or how docker-compose embeds its secrets.</p>