devcontainers / devcontainers/cli

Home Directory appears after "Clone Repository in Container Volume..."

Abierto
#647 4 comentarios 0 reacciones 1 asignado Reclamado por @chrmarti Ver en GitHub
info-needed
Lenguaje dominante
TypeScript
Estrellas
3k
Forks
457
Merge medio
13 h 17 min
PR fusionados (30 d)
6

Descripción

![image](https://github.com/devcontainers/cli/assets/25391699/4f39e209-955d-4d1e-98e2-0855c22f6575)

Everything seems to be working but after cloning this folder appears in /workspaces/utas-dev and I don't know what causes this.

This is my devcontainer.json:

```json
{
"name": "Utas PHP",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/utas-dev",
"customizations": {
"vscode": {
"settings": {
"php.suggest.basic": false
},
"extensions": [
"zobo.php-intellisense"
]
}
},
"portsAttributes": {
"8000": {
"label": "Application",
"onAutoForward": "notify"
},
"8081": {
"label": "Database",
"onAutoForward": "notify"
}
},
"postCreateCommand": "composer update"
}
```

with this docker-compose.yml:

```yaml
version: "3"

services:
app:
build: .
ports:
- "8000:80"
depends_on:
- "mysql.80"

mysql.80:
image: "mysql/mysql-server:8.0"
restart: unless-stopped
volumes:
- db-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: 'secret'
MYSQL_DATABASE: v261
MYSQL_USER: utas
MYSQL_PASSWORD: utas
ports:
- "8081:3306"

volumes:
db-data:
```

and this Dockerfile all in the .devcontainers folder:

```dockerfile
FROM php:8.1-apache

RUN apt-get update && apt-get install -y \
vim \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
git \
libzip-dev \
unzip \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) bcmath gd zip mysqli exif pdo pdo_mysql

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

ENV APACHE_DOCUMENT_ROOT /workspaces/utas-dev

RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN a2enmod rewrite

RUN useradd -ms /bin/bash utas

RUN mkdir -p $APACHE_DOCUMENT_ROOT
RUN chown -R utas:utas $APACHE_DOCUMENT_ROOT
```

Please help me in solving this as I am quite new to the whole dev containers world :)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.