title: About using docker-compose on Container GitHub Codespaces
body: <p>Good morning my friends</p>
  <p>About using docker-compose on Container GitHub Codespaces</p>
  <p>Due to the multi-language support I use &quot;GitHub Codespaces&quot; for container development and would like to add mongodb using docker-compose</p>
  <p>I tried as follows,</p>
  <p>Using the following example as a basis</p>
  <p><a href="https://github.com/microsoft/vscode-dev-containers/blob/main/container-templates/docker-compose/.devcontainer/devcontainer.json" rel="nofollow noreferrer">https://github.com/microsoft/vscode-dev-containers/blob/main/container-templates/docker-compose/.devcontainer/devcontainer.json</a></p>
  <p>In the &quot;.devcontainer&quot; directory</p>
  <p>Added &quot;docker-compose.yml&quot; file with the following content</p>
  <pre><code>version: '3'
  
  services:
    app:
      build:
        context: .
        dockerfile: Dockerfile
  </code></pre>
  <p>I edited the &quot;.devcontainer/devcontainer.json&quot; file</p>
  <p>And I removed the excerpt</p>
  <pre><code>  &quot;build&quot;: {
      &quot;dockerfile&quot;: &quot;Dockerfile&quot;
    },
  </code></pre>
  <p>and added</p>
  <pre><code>  &quot;dockerComposeFile&quot;: &quot;docker-compose.yml&quot;,
    &quot;service&quot;: &quot;app&quot;,
    &quot;workspaceFolder&quot;: &quot;/workspace&quot;,
  </code></pre>
  <p>When building the container for development the following error is returned</p>
  <pre><code>ea8).
  [119 ms] Start: Resolving Remote
  [128 ms] Setting up container for folder or workspace: /home/marcio/dados/acid-workflow-02
  [131 ms] Start: Check Docker is running
  [131 ms] Start: Run: docker version --format {{.Server.APIVersion}}
  [186 ms] Server API version: 1.41
  [198 ms] Start: Run: docker-compose version --short
  [705 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=acid-workflow-02_devcontainer --filter label=com.docker.compose.service=app
  [749 ms] Start: Run: docker-compose -f /home/marcio/dados/acid-workflow-02/.devcontainer/docker-compose.yml config
  [1243 ms] services:
    app:
      build:
        context: /home/marcio/dados/acid-workflow-02/.devcontainer
        dockerfile: Dockerfile
  version: '3.0'
  
  [1243 ms] 
  [1244 ms] Start: Run: docker -v
  [1283 ms] Start: Run: docker events --format {{json .}} --filter event=start
  [1288 ms] Start: Run: docker-compose --project-name acid-workflow-02_devcontainer -f /home/marcio/dados/acid-workflow-02/.devcontainer/docker-compose.yml build
  Building app
  Step 1/29 : FROM mcr.microsoft.com/vscode/devcontainers/universal:1-focal
   ---&gt; 6f68ac61f636
  Step 2/29 : USER root
   ---&gt; Using cache
   ---&gt; 416135f1e190
  Step 3/29 : RUN apt-get update     &amp;&amp; export DEBIAN_FRONTEND=noninteractive     &amp;&amp; apt-get -y install --no-install-recommends jq
   ---&gt; Using cache
   ---&gt; fb937be159ec
  Step 4/29 : RUN curl https://cli-assets.heroku.com/install.sh | sh
   ---&gt; Using cache
   ---&gt; 4c3b8f453f15
  Step 5/29 : USER codespace
   ---&gt; Using cache
   ---&gt; 6de253fb7551
  Step 6/29 : RUN npm install -g netlify-cli
   ---&gt; Using cache
   ---&gt; 6fb737d3ffa9
  Step 7/29 : RUN npm install -g vercel
   ---&gt; Using cache
   ---&gt; Using cache
   ---&gt; fcaf92d1d59b
  Step 28/29 : RUN git config --global user.name &quot;gmail&quot;
   ---&gt; Using cache
   ---&gt; a5a33ea9a51e
  Step 29/29 : RUN git config --global user.email &quot;gmail@gmail.com&quot;
   ---&gt; Using cache
   ---&gt; bad17207e1d1
  Successfully built bad17207e1d1
  Successfully tagged acid-workflow-02_devcontainer_app:latest
  [1996 ms] Start: Run: docker inspect --type image acid-workflow-02_devcontainer_app
  [2051 ms] Start: Run: docker build -f /tmp/vsch/updateUID.Dockerfile-0.191.0 -t vsc-acid-workflow-02-60ab5310082db6cd686579e8f1b62f88-uid --build-arg BASE_IMAGE=acid-workflow-02_devcontainer_app --build-arg REMOTE_USER=codespace --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=codespace /tmp/vsch
  Sending build context to Docker daemon  61.03MB
  Step 1/10 : ARG BASE_IMAGE
  Step 2/10 : FROM $BASE_IMAGE
   ---&gt; bad17207e1d1
  Step 3/10 : USER root
   ---&gt; Using cache
   ---&gt; b1345a3b3a81
  Step 4/10 : ARG REMOTE_USER
   ---&gt; Using cache
   ---&gt; a8ca68a8a1e3
  Step 5/10 : ARG NEW_UID
   ---&gt; Using cache
   ---&gt; 760086d28c88
  Step 6/10 : ARG NEW_GID
   ---&gt; Using cache
   ---&gt; 2155a053cc53
  Step 7/10 : SHELL [&quot;/bin/sh&quot;, &quot;-c&quot;]
   ---&gt; Using cache
   ---&gt; 23633c57bbc3
  Step 8/10 : RUN eval $(sed -n &quot;s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p&quot; /etc/passwd);  eval $(sed -n &quot;s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p&quot; /etc/passwd);   eval $(sed -n &quot;s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p&quot; /etc/group);   if [ -z &quot;$OLD_UID&quot; ]; then              echo &quot;Remote user not found in /etc/passwd ($REMOTE_USER).&quot;;       elif [ &quot;$OLD_UID&quot; = &quot;$NEW_UID&quot; -a &quot;$OLD_GID&quot; = &quot;$NEW_GID&quot; ]; then          echo &quot;UIDs and GIDs are the same ($NEW_UID:$NEW_GID).&quot;;    elif [ &quot;$OLD_UID&quot; != &quot;$NEW_UID&quot; -a -n &quot;$EXISTING_USER&quot; ]; then          echo &quot;User with UID exists ($EXISTING_USER=$NEW_UID).&quot;;    elif [ &quot;$OLD_GID&quot; != &quot;$NEW_GID&quot; -a -n &quot;$EXISTING_GROUP&quot; ]; then            echo &quot;Group with GID exists ($EXISTING_GROUP=$NEW_GID).&quot;; else             echo &quot;Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.&quot;;     sed -i -e &quot;s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/&quot; /etc/passwd;   if [ &quot;$OLD_GID&quot; != &quot;$NEW_GID&quot; ]; then                    sed -i -e &quot;s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/&quot; /etc/group;               fi;             chown -R $NEW_UID:$NEW_GID $HOME_FOLDER;   fi;
   ---&gt; Using cache
   ---&gt; 13f0fd916a8d
  Step 9/10 : ARG IMAGE_USER
   ---&gt; Using cache
   ---&gt; 16efb921b17e
  Step 10/10 : USER $IMAGE_USER
   ---&gt; Using cache
   ---&gt; a4f84f89a8f3
  Successfully built a4f84f89a8f3
  Successfully tagged vsc-acid-workflow-02-60ab5310082db6cd686579e8f1b62f88-uid:latest
  [2583 ms] Start: Run: docker-compose --project-name acid-workflow-02_devcontainer -f /home/marcio/dados/acid-workflow-02/.devcontainer/docker-compose.yml -f /tmp/docker-compose.devcontainer.containerFeatures-1629128082328.yml up -d
  Creating network &quot;acid-workflow-02_devcontainer_default&quot; with the default driver
  Creating acid-workflow-02_devcontainer_app_1 ... done
  [3947 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=acid-workflow-02_devcontainer --filter label=com.docker.compose.service=app
  [4001 ms] Start: Run: docker inspect --type container 590ec81579fc
  [4214 ms] Start: Inspecting container
  [4214 ms] Start: Run: docker inspect --type container 590ec81579fc8789b6cdc99cbeabc2cfd6578c61ad56f00ca74b341bec48c75f
  [4281 ms] Start: Run in container: /bin/sh
  [4298 ms] Start: Run in container: uname -m
  [4425 ms] Start: Run in container: cat /etc/passwd
  [4425 ms] Stdin closed!
  [4429 ms] Shell server terminated (code: 1, signal: null)
  
  Error response from daemon: Container 590ec81579fc8789b6cdc99cbeabc2cfd6578c61ad56f00ca74b341bec48c75f is not running
  
  </code></pre>
  <p>Thank you in advance if you can help</p>