Skip to content

Commit 54fcf24

Browse files
mkakpablaNgob
authored andcommitted
fix buildx: invalid user index: -1: Changing to numeric ID for docker user. Related to issues/1408 from docker/buildx#1408
1 parent c6b5b2c commit 54fcf24

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

apps/back/Dockerfile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ FROM thecodingmachine/${IMAGE_VERSION}-slim-apache as prepare-common-file
99

1010
ARG APP_SOURCE_FILE
1111

12-
COPY --link --chown=docker:docker ./001-symf.conf /etc/apache2/sites-enabled/001-symf.conf
13-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/bin/ /var/www/html/bin/
14-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/.env /var/www/html/.env
15-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/composer.json /var/www/html/composer.json
16-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/composer.lock /var/www/html/composer.lock
17-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/symfony.lock /var/www/html/symfony.lock
12+
COPY --link --chown=1000:1000 ./001-symf.conf /etc/apache2/sites-enabled/001-symf.conf
13+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/bin/ /var/www/html/bin/
14+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/.env /var/www/html/.env
15+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/composer.json /var/www/html/composer.json
16+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/composer.lock /var/www/html/composer.lock
17+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/symfony.lock /var/www/html/symfony.lock
1818
ARG APP_ENV
1919
ENV APP_ENV=${APP_ENV}
2020
RUN if [ "$APP_ENV" != "dev" ] && [ "$APP_ENV" != "prod" ]; then exit 1 ; fi
@@ -66,27 +66,27 @@ ENV PHP_EXTENSION_XDEBUG=1 \
6666
FROM configure-dev as composer-install-dev
6767
ARG APP_SOURCE_FILE
6868

69-
# COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/tests/ /var/www/html/tests/ TODO ONCE WE HAVE TESTING
70-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/phpcs.xml.dist /var/www/html/phpcs.xml.dist
71-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/phpmd.xml /var/www/html/phpmd.xml
72-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/phpstan.neon /var/www/html/phpstan.neon
73-
# COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/phpunit.xml.dist /var/www/html/phpunit.xml.dist TODO ONCE WE HAVE TESTING
74-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/.env.test /var/www/html/.env.test
69+
# COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/tests/ /var/www/html/tests/ TODO ONCE WE HAVE TESTING
70+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/phpcs.xml.dist /var/www/html/phpcs.xml.dist
71+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/phpmd.xml /var/www/html/phpmd.xml
72+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/phpstan.neon /var/www/html/phpstan.neon
73+
# COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/phpunit.xml.dist /var/www/html/phpunit.xml.dist TODO ONCE WE HAVE TESTING
74+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/.env.test /var/www/html/.env.test
7575

7676
RUN composer install --no-scripts --no-interaction
7777

7878
FROM composer-install-${APP_ENV} as composer-install-final
7979

8080
FROM configure-${APP_ENV} as full-files
8181
ARG APP_SOURCE_FILE
82-
COPY --chown=docker:docker --from=composer-install-final /var/www/html /var/www/html
82+
COPY --chown=1000:1000 --from=composer-install-final /var/www/html /var/www/html
8383
# This need to be here to prevent docker to recompile composer layers at each build
84-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/config/ /var/www/html/config/
85-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/migrations/ /var/www/html/migrations/
86-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/phpstan/ /var/www/html/phpstan/
87-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/public/ /var/www/html/public/
88-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/src/ /var/www/html/src/
89-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/migrations/ /var/www/html/migrations/
84+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/config/ /var/www/html/config/
85+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/migrations/ /var/www/html/migrations/
86+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/phpstan/ /var/www/html/phpstan/
87+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/public/ /var/www/html/public/
88+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/src/ /var/www/html/src/
89+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/migrations/ /var/www/html/migrations/
9090
RUN composer run auto-scripts
9191
#RUN composer run console -- cache:clear --no-interaction
9292

apps/front/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ ENV NODE_ENV=$NODE_ENV
99

1010
ARG APP_SOURCE_FILE
1111

12-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/src/ /home/node/app/src/
13-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/nuxt.config.ts /home/node/app/nuxt.config.ts
14-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/package.json /home/node/app/package.json
15-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/yarn.lock /home/node/app/yarn.lock
16-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/.eslintrc.cjs /home/node/app/.eslintrc.cjs
17-
COPY --link --chown=docker:docker ${APP_SOURCE_FILE}/tsconfig.json /home/node/app/tsconfig.json
12+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/src/ /home/node/app/src/
13+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/nuxt.config.ts /home/node/app/nuxt.config.ts
14+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/package.json /home/node/app/package.json
15+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/yarn.lock /home/node/app/yarn.lock
16+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/.eslintrc.cjs /home/node/app/.eslintrc.cjs
17+
COPY --link --chown=1000:1000 ${APP_SOURCE_FILE}/tsconfig.json /home/node/app/tsconfig.json
1818
WORKDIR /home/node/app
1919
RUN ls
2020
RUN yarn install
2121
RUN yarn build
2222

2323
FROM ${IMAGE_VERSION}
24-
COPY --chown=docker:docker --from=prepare-common-front-file /home/node/app /home/node/app
24+
COPY --chown=1000:1000 --from=prepare-common-front-file /home/node/app /home/node/app
2525

2626
CMD node .output/server/index.mjs

0 commit comments

Comments
 (0)