Global делает переменную «Global»
def out():
global x
x = 1
print(x)
return
out()
print (x)
. Это означает, что «x» действует как нормальная переменная вне функции. Если вы выберете глобальное значение, это приведет к ошибке, поскольку не может напечатать переменную внутри функции.
def out():
# Taking out the global will give you an error since the variable x is no longer 'global' or in other words: accessible for other commands
x = 1
print(x)
return
out()
print (x)
Посмотрите эту ссылку https://stackoverflow.com/a/42818261/8442153 или выполните
# sudo -su jenkins
# aws configure
Вам все еще нужно установить интерфейс командной строки AWS внутри док-контейнера.
# Swap to root user to install pip and aws cli then go back to jenkins user
USER root
RUN apt-get update
RUN apt install python3-pip -y
RUN pip3 install awscli --upgrade
USER jenkins