...
Following are the commands needed to create a multi-cpu architecture container image. Let's call the image onap/multi-cpu-app-py.
Note that this flow can be used during the ONAP development-test-debug process. For the release process, the flow is implemented using CI/CD pipelines as shown in the next section.
Source code
Code structure
Code Block |
---|
. ├── app │ ├── main.py │ └── requirements.txt └── Dockerfile |
Python App
Code Block |
---|
from flask import Flask
import platform
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello ONAP. I am a Python service running on " + platform.machine()
if __name__ == "__main__":
app.run(host='0.0.0.0', debug=True, port=5000)
|
Requirements
Code Block |
---|
Flask==0.10.1 |
Dockerfile
Code Block |
---|
FROM python:2.7-alpine
MAINTAINED BY adolfo@orangemonk.net
#Keep it simple
COPY ./app /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD ["main.py"] |
Build arm image (A)
Assuming you have compiled the arm executable for the application, then execute
...