onec-docker
onec-docker copied to clipboard
Передавать ONEC_USERNAME и ONEC_PASSWORD в docker build через build secret
Спасибо кролику за подсказку:
docker build \
- --build-arg ONEC_USERNAME=$ONEC_USERNAME \
- --build-arg ONEC_PASSWORD=$ONEC_PASSWORD \
+ --secret id=onec_credentials,env=ONEC_USERNAME \
+ --secret id=onec_password,env=ONEC_PASSWORD \
--build-arg EDT_VERSION="$EDT_VERSION" \
Update the Dockerfile to use secrets instead of build arguments:
RUN --mount=type=secret,id=onec_credentials \
--mount=type=secret,id=onec_password \
export ONEC_USERNAME=$(cat /run/secrets/onec_credentials) && \
export ONEC_PASSWORD=$(cat /run/secrets/onec_password) && \
# Use credentials here