curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
DaoCloud 安装脚本:
1
curl -sSL https://get.daocloud.io/docker | sh
两个脚本可以任选其一,速度都非常不错。
等待脚本执行完毕之后,就可以使用 Docker 相关命令了,如运行测试 Hello World 镜像:
1
docker run hello-world
运行结果:
1 2 3 4 5 6 7
Unable tofind image 'hello-world:latest' locally latest: Pulling from library/hello-world 78445dd45222: Pull complete Digest:sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears tobe working correctly.
如果出现上文类似提示内容则证明 Docker 可以正常使用了。
Mac 下的安装
Mac 平台同样有两种选择,Docker for Mac 和 Docker Toolbox。
Docker for Mac 要求系统为 OS X EI Captain 10.11 或更新,至少 4GB 内存,如果你的系统满足此要求,则强烈建议安装 Docker for Mac。
codesnap.backgroundColor: The background color of the snippet's container. Can be any valid CSS color. codesnap.boxShadow: The CSS box-shadow for the snippet. Can be any valid CSS box shadow. codesnap.containerPadding: The padding for the snippet's container. Can be any valid CSS padding.
codesnap.roundedCorners: Boolean value to use rounded corners or square corners for the window.
codesnap.showWindowControls: Boolean value to show or hide OS X style window buttons.
codesnap.showWindowTitle: Boolean value to show or hide window title folder_name - file_name.
codesnap.showLineNumbers: Boolean value to show or hide line numbers.
codesnap.realLineNumbers: Boolean value to start from the real line number of the file instead of1.
codesnap.transparentBackground: Boolean value to use a transparent background when taking the screenshot.
codesnap.target: Either container to take the screenshot with the container, or window to only take the window.
codesnap.shutterAction: Either save to save the screenshot into a file, or copy to copy the screenshot into the clipboard.
Your git information is not valid Please run: git config --local user.name "<Your name in Microsoft>" git config --local user.email "<alias>@microsoft.com"
response data: {'status': 0, 'msg': 'ok', 'data': {'taskId': '1479436991'}} create task successfully 1479436991 polling result {'status': 0, 'msg': 'ok', 'data': {'status': 'Working'}} status of task Working polling result {'status': 0, 'msg': 'ok', 'data': {'status': 'Working'}} status of task Working polling result {'status': 0, 'msg': 'ok', 'data': {'status': 'Working'}} status of task Working polling result {'status': 0, 'msg': 'ok', 'data': {'status': 'Success', 'response': '03AGdBq27-ABqvNmgq96iuprN8Mvzfq6_8noknIed5foLb15oWvWVksq9KesDkDd7dgMMr-UmqULZduXTWr87scJXl3djhl2btPO721eFAYsVzSk7ftr4uHBdJWonnEemr9dNaFB9qx5pnxr3P24AC7cCfKlOH_XARaN4pvbPNxx_UY5G5fzKUPFDOV14nNkCWl61jwwC0fuwetH1q99r4hBQxyI6XICD3PiHyHJMZ_-wolcO1R9C90iGQyjzrSMiNqErezO24ODCiKRyX2cVaMwM9plbxDSuyKUVaDHqccz8UrTNNdJ4m2WxKrD9wZDWaSK10Ti1LgsqOWKjKwqBbuyRS_BkSjG6OJdHqJN4bpk_jAcPMO13wXrnHBaXdK4FNDR9-dUvupHEnr7QZEuNoRxwl8FnO2Fgwzp2sJbGeQkMbSVYWdAalE6fzJ8NwsFJxCdDyeyO817buBtvTJ4C06C1uZ92fpPTeYGJwbbicOuqbGfHNTyiSJeRNmt-5RKz0OUiPJOPnmVKGlWBOqwbwCW1WZt-E-hH4FEg4En5TITmmPb_feS9dWKUxudn1U0hHk2vV9PerjZLtI7F67KtgmcqRrARPbwnc6KyAi3Hy1hthP92lv4MRIcO2jx0Llvsja-G2nhjZB0ZoJwkb9106pmqldiwlXxky4Dcg7VPStiCYJvhQpRYol7Iq1_ltU2tyhMqsu_Xa8Z6Mr5ykRCLnmlLb8DV8isndrdwp84wo_vPARGRj7Up9ov-ycb5lDKTf1XRaHiMCa8d2WLy0Pjco9UnsRAPw0FW3MsBJah6ryHUUDho7ffhUUgV1k86ryJym6xbWch1sVC4D5owzrCFn6L-rSLc5SS1pza2zU5LK4kAZCmbXNRffiFrhUY8nP4T1xaR2KMhIaN8HhJQpR8sQh1Azc-QkDy4rwbYmxUrysYGMrAOnmDx9z7tWQXbJE4IgCVMx5wihSiE-T8nbF5y1aJ0Ru9zqg1nZ3GSqsucSnvJA8HV5t9v0QSG5cBC1x5HIceA-2uEGSjwcmYOMw8D_65Dl-d6yVk1YN2FZCgMWY5ewzB1RAFN1BMqKoITQJ64jq3lKATpkc5i7aTA2bRGQyXrbDyMRIrVXKnYMHegfMbDn0l4O81a8vxmevLspKkacVPiqLsAe-73jAxMvsOqaG7cKxMQO9CY3qbtD55YgN0W4p2jyNSVz3aEpffHRqYyWMsRI5LddLgaZQDoHHgGUhV580PSIdZJ5eKd0gOjxIYxKlr0IgbMWRmsG_TgDNImy1c5oey8ojl-zWpOQW7bnfq5Z4tZ10_sCTfoOZVLqRuOsqB1OOO9pLRQojLBP0HUiGhRAr_As9EIDu6F9NIQfdAmCaVvavJbi1CZITFjcywP-tBrHsxpwkCXlwl996MK_XyEDuyWnJVGiVSthUMY306tIh1Xxj93W3KQJCzsfJQcjN-3lGLLeDFddypHyG4yrpRqRHHBNyiNJHgxSk5SaShEhXvByjkepvhrKX3kJssCU04biqqmkrQ49GqBV9OsWIy0nN3OJTx8v05MP8aU8YYkYBF01UbSff4mTfLAhin6iWk84Y074mRbe2MbgFAdU58KnCrwYVxcAR8voZsFxbxNwZXdVeexNx5HlIlSgaAHLWm2kFWmGPPW-ZA7R8Wst-mc7oIKft5iJl8Ea0YFz8oXyVgQk1rd9nDR3xGe5mWL1co0MiW1yvHg'}}
""" Parse the list of expenses and return the list of triples (date, value, currency). Ignore lines starting with #. Parse the date using datetime. Example expenses_string: 2016-01-02 -34.01 USD 2016-01-03 2.59 DKK 2016-01-03 -2.72 EUR """
Trained on billions of lines of public code, GitHub Copilot puts the knowledge you need at your fingertips, saving you time and helping you stay focused.
from flask import Flask, request, jsonify from loguru import logger
app = Flask(__name__)
@app.route('/sms', methods=['POST']) defreceive(): sms_content = request.form.get('content') logger.debug(f'received {sms_content}') # parse content and save to db or mq return jsonify(status='success')
if __name__ == '__main__': app.run(debug=True)
代码很简单,这里设置了一个路由,接收 POST 请求,然后读取了 Request 表单的内容,其中 content 就是短信的详情内容,然后将其打印出来。
我们将代码保存为 server.py,然后将其运行起来:
1
python3 server.py
运行结果输出如下:
1 2 3 4 5
* Debug mode: on * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) * Restarting with stat * Debugger is active! * Debugger PIN: 269-657-055
Session Status online Session Expires 1 hour, 59 minutes Update update available (version 2.3.40, Ctrl-U to update) Version 2.3.35 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding http://1259539cb974.ngrok.io -> http://localhost:5000 Forwarding https://1259539cb974.ngrok.io -> http://localhost:5000