我正在尝试解密docker容器中的gpg
文件。粗略地说Dockerfile
做了基本的事情:
FROM myimage
RUN ...
...
COPY docker-entrypoint.sh /entrypoint
RUN chmod u+x /entrypoint
docker-entrypoint.sh
包含:
gpg --decrypt --passphrase=${PASSWORD} /path/to/encrypted/file > /path/to/unencrypted/file
...
exec "$@"
我在做:
docker build -t "myimage" .
docker run -e PASSWORD -ti myimage
我得到了:
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
usage: gpg [options] --decrypt [filename]
......作为一个错误。密码环境var正在正确传递,并且该命令在我的机器上正确运行。
我尝试使用gpg2
但没有成功。
答案 0 :(得分:0)
我刚刚发现了这个问题:
import csv
delimiter_type=';'
with open('file_name.csv', 'wb') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=delimiter_type,
quotechar='|', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])
spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])
即。应使用引号,以便将环境变量正确转换为文本。