No context, just a quoted code. You will need to work on your question to get help. The topic remains unlisted until you add more information that can actually help to understand your issue and what you did to get the error message.
$ bash --version
GNU bash, versione 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
Licenza GPLv3+: GNU GPL versione 3 o successiva <http://gnu.org/licenses/gpl.html>
Questo è software libero; sei libero di cambiare e ridistribuirlo.
NON esiste alcuna GARANZIA, nella misura consentita dalla legge.
$ pwd
/tmp/tmp.nI5p0BRXiB
$ docker compose config
WARN[0000] The "UID" variable is not set. Defaulting to a blank string.
name: tmpni5p0brxib
services:
test:
annotations:
uid: ""
user: my-name
image: bash
networks:
default: null
networks:
default:
name: tmpni5p0brxib_default
But I would like inside-docker to have the same user-id/group-id as out-docker (1000).
+ docker compose --file compose-2.yml run --rm test touch /data/inside-docker
WARN[0000] The "UID" variable is not set. Defaulting to a blank string.
WARN[0000] The "UID" variable is not set. Defaulting to a blank string.
It’s because UID is not an environment variable, but a bash “internal” variable. As such, it does not get exported to child processes like docker-compose or the docker CLI. USER, on the other hand, is and does. See here.
To solve your problem, I would set a different variable’s value to $UID, and use that in the compose file.