title: NoCredentialProviders error when running "docker compose up" with AWS ECS integration
body: <p>I'm getting the following error when I try to run <code>docker compose up</code> to deploy my infrastructure to AWS using Docker's ECS integration. Note that I'm running this on Pop!_OS 21.10, which is based on Ubuntu.</p>
  <p><code>NoCredentialProviders: no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors</code></p>
  <p>Things I've tried, based on an exhaustive search of SO and other sites:</p>
  <ul>
  <li>Verified the proper format of my <code>~/.aws/config</code> and <code>~/.aws/credentials</code> files are formatted correctly, are in the proper place, and have the correct permissions</li>
  <li>Verified that the aws cli works fine</li>
  <li>Verify that <code>AWS_ACCESS_KEY_ID</code>, <code>AWS_SECRET_ACCESS_KEY</code>, <code>AWS_REGION</code> are all set correctly</li>
  <li>Tried copying the config and credentials to <code>/root/.aws</code></li>
  <li>Tried setting <code>AWS_ACCESS_KEY_ID</code>, <code>AWS_SECRET_ACCESS_KEY</code>, <code>AWS_REGION</code> in the root user's environment</li>
  <li>Created <code>/etc/systemd/system/docker.service.d/aws-credentials.conf</code> and populated it with:</li>
  </ul>
  <pre><code>[Service]
  Environment=&quot;AWS_ACCESS_KEY_ID=********************&quot;
  Environment=&quot;AWS_SECRET_ACCESS_KEY=****************************************&quot;
  </code></pre>
  <ul>
  <li>Ran <code>docker -l debug compose up</code> (Only extra information it provides is <code>DEBUG deploying on AWS with region=&quot;us-east-1&quot;</code></li>
  </ul>
  <p>I'm running out of options. If anyone has any other ideas to try, I'd love to hear it. Thanks!</p>
  <p>Update: I've also now tried the following, with no luck:</p>
  <ul>
  <li>Tried setting <code>Environment=&quot;AWS_SHARED_CREDENTIALS_FILE=/home/kespan/.aws/credentials</code></li>
  <li>Tried setting <code>Environment=&quot;AWS_SHARED_CREDENTIALS_FILE=/home/kespan/.aws/credentials</code> in <code>/etc/systemd/system/docker.service.d/override.conf</code></li>
  <li>After remembering my IAM account has MFA enabled, generated a token and added <code>Environment=&quot;AWS_SESSION_TOKEN=...&quot;</code> to <code>override.conf</code></li>
  </ul>
  <p>Also to note - each time after I've added/modified files under <code>/etc/systemd/system/docker.service.d/</code> I've run:</p>
  <pre><code>sudo systemctl daemon-reload
  sudo systemctl restart docker
  </code></pre>
  <p>Edit:</p>
  <p>Here's one of the Dockerfiles (both the scraper and scheduler use an identical Dockerfile):</p>
  <pre><code>FROM denoland/deno:alpine
  WORKDIR /app
  USER deno
  COPY deps.ts .
  RUN deno cache --unstable --no-check deps.ts
  COPY . .
  RUN deno cache --unstable --no-check mod.ts
  RUN mkdir -p /var/tmp/log
  CMD [&quot;run&quot;, &quot;--unstable&quot;, &quot;--allow-all&quot;, &quot;--no-check&quot;, &quot;mod.ts&quot;]
  </code></pre>
  <p>Here's my docker-compose (some bits redacted):</p>
  <pre><code>version: '3'
  services:
    grafana:
      container_name: grafana
      image: grafana/grafana
      ports:
        - &quot;3000:3000&quot;
      volumes:
        - grafana:/var/lib/grafana
      deploy:
        replicas: 1
    scheduler:
      image: scheduler
      x-aws-pull-credentials: &quot;arn...&quot;
      container_name: scheduler
      environment:
        DB_CONNECTION_STRING: &quot;postgres://...&quot;
        SQS_URL: &quot;...&quot;
        SQS_REGION: &quot;us-east-1&quot;
        AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
        AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
      deploy:
        replicas: 1
    scraper:
      image: scraper
      x-aws-pull-credentials: &quot;arn...&quot;
      container_name: scraper
      environment:
        DB_CONNECTION_STRING: &quot;postgres://...&quot;
        SQS_URL: &quot;...&quot;
        SQS_REGION: &quot;us-east-1&quot;
        AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
        AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
      deploy:
        replicas: 1
  volumes:
    grafana:
  </code></pre>