小编Eth*_*ill的帖子

kubectl exec works on single commands, but I cannot enter a bash shell

I'm on macOS Catalina 10.15.4, and I'm using minikube v1.11.0 and kubernetes v1.18.3, both installed from brew. Minikube is initialized with the docker engine.

The initialization command is set up like so:

      containers:
        - name: database
          image: "mysql:5.6"
          imagePullPolicy: IfNotPresent
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: 12345
            - name: MYSQL_USER
              value: user
            - name: MYSQL_PASSWORD
              value: password
            - name: MYSQL_DATABASE
              value: db
Run Code Online (Sandbox Code Playgroud)

I'm trying to get a bash script open for one of my running kubectl containers. From research …

bash docker kubernetes kubectl minikube

6
推荐指数
1
解决办法
6249
查看次数

WebDriverException:Chrome无法启动:异常退出(未知错误:DevToolsActivePort文件不存在)

尽管版本正确并且安装了 UI,但使用 Selenium 的 Python 脚本无法创建 Chrome 实例。

我已经在这里查看了类似的线程,但似乎都没有解决问题。该代码在 Windows 上运行 - 一旦我尝试在 Linux 上执行它,它就不再运行。我的预期目标是让它以可视方式打开 Chrome,因此我并不是在寻找涉及虚拟显示的解决方案。

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--no-sandbox')

driver = webdriver.Chrome('/home/ethan/chromedriver', chrome_options=options)
driver.set_window_size(1024, 600)
driver.maximize_window()
Run Code Online (Sandbox Code Playgroud)

我安装了 Google Chrome 75.0.3770.100 我还安装了 ChromeDriver 75.0.3770.90

这是代码的完整回溯:

File "cm_update_01.py", line 114, in <module>
    if __name__ == "__main__": main()
  File "cm_update_01.py", line 24, in main
    with open(fetch_file()) as f:
  File "cm_update_01.py", line 75, in fetch_file
    driver = webdriver.Chrome('/home/ethan/chromedriver', chrome_options=options)
  File "/home/ethan/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in …
Run Code Online (Sandbox Code Playgroud)

python selenium python-3.x selenium-chromedriver selenium-webdriver

5
推荐指数
1
解决办法
2万
查看次数

“欢迎来到 Nginx!” - Docker-Compose,使用uWSGI、Flask、nginx

我的问题:

欢迎来到 Nginx! 溅

我正在使用 Ubuntu 18.04 和基于 docker-compose 的解决方案,其中包含两个 Docker 映像,一个用于处理 Python/uWSGI,另一个用于我的 NGINX 反向代理。无论我进行什么更改,WSGI 似乎始终无法检测到我的默认应用程序。每当我运行docker-compose up并导航到 时,localhost:5000我都会得到上面的默认启动画面。

完整的程序似乎可以在我们的 CentOS 7 机器上运行。然而,当我尝试在 Ubuntu 测试机上执行它时,我只能得到“Welcome to NGINX!” 页。

目录结构:

 /app
  - app.conf
  - app.ini
  - app.py
  - docker-compose.py
  - Dockerfile-flask
  - Dockerfile-nginx
  - requirements.txt
  /templates
Run Code Online (Sandbox Code Playgroud)

(所有代码片段均已简化,以帮助隔离问题)

这是我的 docker 回溯的示例:

时钟烧瓶_1

[uWSGI] getting INI configuration from app.ini
current working directory: /app
detected binary path: /usr/local/bin/uwsgi
uwsgi socket 0 bound to TCP address 0.0.0.0:5000 fd 3
*** WARNING: …
Run Code Online (Sandbox Code Playgroud)

nginx docker

4
推荐指数
1
解决办法
3034
查看次数

Python 简单套接字 - 从客户端请求获取 URL

对于一项学校作业,我需要填写一个充当简单代理服务器的示例 Python 3 应用程序的空白。我只需要使用套接字库。

我的问题在于,我没有被教导如何从客户端提取请求的 URL,也无法在网上找到帮助我的信息。这是到目前为止的代码(我将它们包含在内是为了给出我需要编写的 Python 风格的示例):

from socket import socket, gethostname, AF_INET, SOCK_STREAM
import sys

if len(sys.argv) <= 1:
    print ("Usage : 'python ProxyServer.py server_ip'\nserver_ip : It is the IP Address Of Proxy Server")
    sys.exit(2)

# Create a server socket, bind it to a port and start listening 
tcpSerSock = socket(AF_INET, SOCK_STREAM)
tcpSerSock.bind(('localhost', 8888))
tcpSerSock.listen(5)

while 1: 

    # Start receiving data from the client 
    print ('Ready to serve...' )

    tcpCliSock, addr = tcpSerSock.accept()
    print ('Received a connection from:', …
Run Code Online (Sandbox Code Playgroud)

python sockets tcp python-3.x

2
推荐指数
1
解决办法
4930
查看次数