Portus | Authorization service and frontend for Docker registry | Continuous Deployment library

 by   SUSE Ruby Version: 2.4.3 License: Apache-2.0

kandi X-RAY | Portus Summary

Portus is a Ruby library typically used in Devops, Continuous Deployment, Docker applications. Portus has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
Portus is an authorization server and a user interface for the next generation of the Docker registry. Portus targets version 2 of the Docker Registry API. The minimum required version of Registry is 2.1, which is the first version supporting soft deletes of blobs.
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        Portus has a medium active ecosystem.
                        summary
                        It has 2986 star(s) with 483 fork(s). There are 105 watchers for this library.
                        summary
                        It had no major release in the last 12 months.
                        summary
                        There are 126 open issues and 980 have been closed. On average issues are closed in 290 days. There are 30 open pull requests and 0 closed requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of Portus is 2.4.3
                        Portus Support
                          Best in #Continuous Deployment
                            Average in #Continuous Deployment
                            Portus Support
                              Best in #Continuous Deployment
                                Average in #Continuous Deployment

                                  kandi-Quality Quality

                                    summary
                                    Portus has 0 bugs and 0 code smells.
                                    Portus Quality
                                      Best in #Continuous Deployment
                                        Average in #Continuous Deployment
                                        Portus Quality
                                          Best in #Continuous Deployment
                                            Average in #Continuous Deployment

                                              kandi-Security Security

                                                summary
                                                Portus has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                summary
                                                Portus code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                Portus Security
                                                  Best in #Continuous Deployment
                                                    Average in #Continuous Deployment
                                                    Portus Security
                                                      Best in #Continuous Deployment
                                                        Average in #Continuous Deployment

                                                          kandi-License License

                                                            summary
                                                            Portus is licensed under the Apache-2.0 License. This license is Permissive.
                                                            summary
                                                            Permissive licenses have the least restrictions, and you can use them in most projects.
                                                            Portus License
                                                              Best in #Continuous Deployment
                                                                Average in #Continuous Deployment
                                                                Portus License
                                                                  Best in #Continuous Deployment
                                                                    Average in #Continuous Deployment

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        Portus releases are available to install and integrate.
                                                                        summary
                                                                        Installation instructions are not available. Examples and code snippets are available.
                                                                        summary
                                                                        Portus saves you 11487 person hours of effort in developing the same functionality from scratch.
                                                                        summary
                                                                        It has 23237 lines of code, 754 functions and 641 files.
                                                                        summary
                                                                        It has medium code complexity. Code complexity directly impacts maintainability of the code.
                                                                        Portus Reuse
                                                                          Best in #Continuous Deployment
                                                                            Average in #Continuous Deployment
                                                                            Portus Reuse
                                                                              Best in #Continuous Deployment
                                                                                Average in #Continuous Deployment
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi has reviewed Portus and discovered the below as its top functions. This is intended to give you an instant insight into Portus implemented functionality, and help decide if they suit your requirements.
                                                                                  • Perform an HTTP request .
                                                                                    • Internal handle error message .
                                                                                      • Returns a Markdown markdown text .
                                                                                        • Initialize the registry
                                                                                          • Change this role
                                                                                            • Destroy a repository
                                                                                              • Initializes the Registry
                                                                                                • Destroy a list of accounts
                                                                                                  • Sets the owner of a user .
                                                                                                    • Deletes the given namespace
                                                                                                      Get all kandi verified functions for this library.
                                                                                                      Get all kandi verified functions for this library.

                                                                                                      Portus Key Features

                                                                                                      Website | Documentation | Blog | Supported versions | How to deploy
                                                                                                      Mailing list: Google Groups
                                                                                                      Last stable release: 2.4.3 (2.4, 2.4.3 and latest tags from the official Docker image)

                                                                                                      Portus Examples and Code Snippets

                                                                                                      No Code Snippets are available at this moment for Portus.
                                                                                                      Community Discussions

                                                                                                      Trending Discussions on Portus

                                                                                                      Jest: Testing issue with process.env.PORT
                                                                                                      chevron right
                                                                                                      docker login behind proxy on private registry gives TLS handshake timeout
                                                                                                      chevron right
                                                                                                      Python nmap: TypeError: list indices must be integers or slices, not str
                                                                                                      chevron right
                                                                                                      How to send and receive webcam stream using tcp sockets in Python?
                                                                                                      chevron right
                                                                                                      docker run Error: Can't find python executable to run
                                                                                                      chevron right

                                                                                                      QUESTION

                                                                                                      Jest: Testing issue with process.env.PORT
                                                                                                      Asked 2020-Mar-17 at 09:49

                                                                                                      EDIT: after playing around a little I realized that the issue is not related to the process variables, but to the fact that my server instance is executed only once for some reason. I'm still looking into it, I'll keep the post updated.

                                                                                                      I am trying to get 100% coverage, but I'm stuck at testing this line:

                                                                                                      const port = config.get("port") || process.env.PORT || 3000;
                                                                                                      

                                                                                                      It seems that I can't set process.env.PORT more than once.

                                                                                                      const config = require("config");
                                                                                                      
                                                                                                      // This checks if a port is being used
                                                                                                      function portUsed(port) {
                                                                                                        return new Promise((resolve, reject) => {
                                                                                                          const net = require("net");
                                                                                                          const server = net.createServer();
                                                                                                      
                                                                                                          server.once("error", err => {
                                                                                                            if (err.code === "EADDRINUSE") {
                                                                                                              resolve(true);
                                                                                                            }
                                                                                                          });
                                                                                                      
                                                                                                          server.once("listening", () => {
                                                                                                            server.close();
                                                                                                            resolve(false);
                                                                                                          });
                                                                                                      
                                                                                                          server.listen(port);
                                                                                                        });
                                                                                                      }
                                                                                                      
                                                                                                      describe("index", () => {
                                                                                                        // this works
                                                                                                        it("should use process.env.PORT if config.get('port') is not set", async () => {
                                                                                                          config.port = null;
                                                                                                          process.env.PORT = 3333;
                                                                                                          const server = require("../../index");
                                                                                                          const result = await portUsed(3333);
                                                                                                          expect(result).toBe(true);
                                                                                                          await server.close();
                                                                                                        });
                                                                                                      
                                                                                                        // This does not work, but if you comment out / remove the previous test, it will work!
                                                                                                        it("should default to port 3000 if other variables are not set", async () => {
                                                                                                          config.port = null;
                                                                                                          delete process.env.PORT;
                                                                                                          const server = require("../../index");
                                                                                                          const result = await portUsed(3000);
                                                                                                          expect(result).toBe(true);
                                                                                                          await server.close();
                                                                                                        });
                                                                                                      
                                                                                                      });
                                                                                                      

                                                                                                      Basically only one of those two tests will run. What am I doing wrong?

                                                                                                      index.js

                                                                                                      const express = require("express");
                                                                                                      const app = express();
                                                                                                      const config = require("config");
                                                                                                      
                                                                                                      const logger = require("./startup/logging");
                                                                                                      require("./startup/console")(app);
                                                                                                      require("./startup/database")();
                                                                                                      require("./startup/routes")(app);
                                                                                                      
                                                                                                      app.use(express.urlencoded({ extended: true }));
                                                                                                      
                                                                                                      logger.info(config.get("name"));
                                                                                                      // delete config.port;
                                                                                                      // delete process.env.PORT;
                                                                                                      // console.log("config", config.port);
                                                                                                      console.log("server", process.env.PORT);
                                                                                                      const port = config.get("port") || process.env.PORT || 3000;
                                                                                                      const server = app.listen(port, () => logger.info(`Listening on port ${port}.`));
                                                                                                      
                                                                                                      module.exports = server;
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2020-Mar-17 at 03:27

                                                                                                      The reason why my test were not working is because the modules required (require("../../index.js")) will be cached, hence only one instance of the server is created. To solve this just use:

                                                                                                      beforeEach(() => jest.resetModules());
                                                                                                      

                                                                                                      Source https://stackoverflow.com/questions/60715550

                                                                                                      QUESTION

                                                                                                      docker login behind proxy on private registry gives TLS handshake timeout
                                                                                                      Asked 2019-Aug-12 at 23:25

                                                                                                      We have a private docker registry at work (based on portus, but whatever) and I try to push an image to this registry but it doesn't work. It fails with the following error message:

                                                                                                      $ sudo docker login archive.docker-registry.mycompany.com
                                                                                                      Username: mylogin
                                                                                                      Password: 
                                                                                                      Error response from daemon: Get https://archive.docker-registry.mycompany.com/v1/users/:
                                                                                                          net/http: TLS handshake timeout
                                                                                                      $ 
                                                                                                      

                                                                                                      I already configured the proxy in /etc/systemd/system/docker.service.d/http-proxy.conf (my docker is on centos 7):

                                                                                                      [Service]
                                                                                                      Environment="HTTP_PROXY=http://proxy.mycompany.com:8000/" "NO_PROXY=localhost,127.0.0.1,archive.docker-registry.mycompany.com"
                                                                                                      

                                                                                                      but it still fails.

                                                                                                      I tried to use HTTPS_PROXY instead of HTTP_PROXY using either http or https in url, I tried to download certificate manually and configure them in system (update-ca-certs) but it keeps failing.

                                                                                                      When I changed this configuration file, as root, I executed:

                                                                                                      # systemctl daemon-reload
                                                                                                      # systemctl restart docker
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2017-Apr-21 at 11:48

                                                                                                      actually, I found that if I comment out the full Environment line it works for the private registry but not for docker hub anymore (of course, no more proxy). And here is the final solution that works for both private registry and docker hub public registry:

                                                                                                      In the NO_PROXY environment variable, only the domain name should be used, not the FQDN (including "archive." hostname prefix):

                                                                                                      Here is my config file now:

                                                                                                      [Service]
                                                                                                      Environment="HTTP_PROXY=http://proxy.mycompany.com:8000/" "NO_PROXY=localhost,127.0.0.1,docker-registry.mycompany.com"
                                                                                                      

                                                                                                      Note that there is no more "archive." nor "portus." prefix in NO_PROXY anymore, just the domain name starting from "docker-registry".

                                                                                                      As I saw the docker login command line including "archive." prefix, it was misleading and I thought it had to be in the NO_PROXY environment variable... but no, it should not.

                                                                                                      Hope it helps someone. I wish I found the answer on google before, but I didn't so I'm just posting it here, it might help someone.

                                                                                                      Source https://stackoverflow.com/questions/43541963

                                                                                                      QUESTION

                                                                                                      Python nmap: TypeError: list indices must be integers or slices, not str
                                                                                                      Asked 2019-Jul-29 at 23:23

                                                                                                      I'm trying to get the target system port id using nmap module but getting list indices error

                                                                                                      import nmap
                                                                                                      nm_scan = nmap.PortScanner()
                                                                                                      nm_scanner = nm_scan.scan('192.168.0.1', '80', arguments='-O')
                                                                                                      print("Portid: " + nm_scanner['scan']['192.168.0.1']['portused']['portid'])
                                                                                                      

                                                                                                      print("The host is: " + nm_scanner['scan']['192.168.0.1']['portused']['portid']) TypeError: list indices must be integers or slices, not str

                                                                                                      print(nm_scanner)
                                                                                                      
                                                                                                      {
                                                                                                        'nmap': {
                                                                                                          'command_line': 'nmap -oX - -p 80 -O 192.168.0.1',
                                                                                                          'scaninfo': {
                                                                                                            'tcp': {
                                                                                                              'method': 'syn',
                                                                                                              'services': '80'
                                                                                                            }
                                                                                                          },
                                                                                                          'scanstats': {
                                                                                                            'timestr': 'Fri Jul 26 11:31:30 2019',
                                                                                                            'elapsed': '6.36',
                                                                                                            'uphosts': '1',
                                                                                                            'downhosts': '0',
                                                                                                            'totalhosts': '1'
                                                                                                          }
                                                                                                        },
                                                                                                        'scan': {
                                                                                                          '192.168.0.1': {
                                                                                                            'hostnames': [
                                                                                                              {
                                                                                                                'name': '',
                                                                                                                'type': ''
                                                                                                              }
                                                                                                            ],
                                                                                                            'addresses': {
                                                                                                              'ipv4': '192.168.0.1',
                                                                                                              'mac': '1C:5F:2B:53:45:4F'
                                                                                                            },
                                                                                                            'vendor': {
                                                                                                              '1C:5F:2B:53:45:4F': 'D-Link International'
                                                                                                            },
                                                                                                            'status': {
                                                                                                              'state': 'up',
                                                                                                              'reason': 'arp-response'
                                                                                                            },
                                                                                                            'uptime': {
                                                                                                              'seconds': '87161',
                                                                                                              'lastboot': 'Thu Jul 25 11:18:49 2019'
                                                                                                            },
                                                                                                            'tcp': {
                                                                                                              80: {
                                                                                                                'state': 'open',
                                                                                                                'reason': 'syn-ack',
                                                                                                                'name': 'http',
                                                                                                                'product': '',
                                                                                                                'version': '',
                                                                                                                'extrainfo': '',
                                                                                                                'conf': '3',
                                                                                                                'cpe': ''
                                                                                                              }
                                                                                                            },
                                                                                                            'portused': [
                                                                                                              {
                                                                                                                'state': 'open',
                                                                                                                'proto': 'tcp',
                                                                                                                'portid': '80'
                                                                                                              },
                                                                                                              {
                                                                                                                'state': 'closed',
                                                                                                                'proto': 'udp',
                                                                                                                'portid': '42514'
                                                                                                              }
                                                                                                            ],
                                                                                                            'osmatch': [
                                                                                                              {
                                                                                                                'name': 'Allied Telesyn AT-GS950 or D-Link DES-3226L switch or D-Link DSL-2750U router',
                                                                                                                'accuracy': '100',
                                                                                                                'line': '2603',
                                                                                                                'osclass': [
                                                                                                                  {
                                                                                                                    'type': 'switch',
                                                                                                                    'vendor': 'Allied Telesyn',
                                                                                                                    'osfamily': 'embedded',
                                                                                                                    'osgen': None,
                                                                                                                    'accuracy': '100',
                                                                                                                    'cpe': [
                                                                                                                      'cpe:/h:alliedtelesyn:at-gs950'
                                                                                                                    ]
                                                                                                                  },
                                                                                                                  {
                                                                                                                    'type': 'switch',
                                                                                                                    'vendor': 'D-Link',
                                                                                                                    'osfamily': 'embedded',
                                                                                                                    'osgen': None,
                                                                                                                    'accuracy': '100',
                                                                                                                    'cpe': [
                                                                                                                      'cpe:/h:dlink:des-3226l',
                                                                                                                      'cpe:/h:dlink:dsl-2750u'
                                                                                                                    ]
                                                                                                                  }
                                                                                                                ]
                                                                                                              }
                                                                                                            ]
                                                                                                          }
                                                                                                        }
                                                                                                      }
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2019-Jul-26 at 06:02

                                                                                                      You are using string indices for nm_scanner and not numbers. Is nm_scanner a dictionary or list? You can know by saying the following.

                                                                                                      type(nm_scanner)
                                                                                                      

                                                                                                      If it is a list then you have to use numbers as index (in the square brackets). You can use string for dictionary. You can help us more by printing the nm_scanner and pasting here.

                                                                                                      Source https://stackoverflow.com/questions/57213890

                                                                                                      QUESTION

                                                                                                      How to send and receive webcam stream using tcp sockets in Python?
                                                                                                      Asked 2018-Aug-19 at 20:59

                                                                                                      I am trying to recreate this project. What I have is a server (my computer), and a client (my raspberry pi). What I am doing differently than the original project is that I am trying to use a simple webcam instead of a raspberry pi camera to stream images from my rpi to the server. I know that I must:

                                                                                                      1. Get opencv image frames from the camera.
                                                                                                      2. Convert a frame (which is a numpy array) to bytes.
                                                                                                      3. Transfer the bytes from the client to the server.
                                                                                                      4. Convert the bytes back into frames and view.

                                                                                                      Examples would be appreciated.

                                                                                                      self_driver.py

                                                                                                      import SocketServer
                                                                                                      import threading
                                                                                                      import numpy as np
                                                                                                      import cv2
                                                                                                      import sys
                                                                                                      
                                                                                                      
                                                                                                      ultrasonic_data = None
                                                                                                      
                                                                                                      #BaseRequestHandler is used to process incoming requests
                                                                                                      class UltrasonicHandler(SocketServer.BaseRequestHandler):
                                                                                                      
                                                                                                          data = " "
                                                                                                      
                                                                                                          def handle(self):
                                                                                                      
                                                                                                              while self.data:
                                                                                                                  self.data = self.request.recv(1024)
                                                                                                                  ultrasonic_data = float(self.data.split('.')[0])
                                                                                                                  print(ultrasonic_data)
                                                                                                      
                                                                                                      
                                                                                                      #VideoStreamHandler uses streams which are file-like objects for communication
                                                                                                      class VideoStreamHandler(SocketServer.StreamRequestHandler):
                                                                                                      
                                                                                                          def handle(self):
                                                                                                              stream_bytes = b''
                                                                                                      
                                                                                                              try:
                                                                                                                  stream_bytes += self.rfile.read(1024)
                                                                                                                  image = np.frombuffer(stream_bytes, dtype="B")
                                                                                                                  print(image.shape)
                                                                                                                  cv2.imshow('F', image)
                                                                                                                  cv2.waitKey(0)
                                                                                                      
                                                                                                              finally:
                                                                                                                  cv2.destroyAllWindows()
                                                                                                                  sys.exit()
                                                                                                      
                                                                                                      
                                                                                                      class Self_Driver_Server:
                                                                                                      
                                                                                                          def __init__(self, host, portUS, portCam):
                                                                                                              self.host = host
                                                                                                              self.portUS = portUS
                                                                                                              self.portCam = portCam
                                                                                                      
                                                                                                          def startUltrasonicServer(self):
                                                                                                              # Create the Ultrasonic server, binding to localhost on port 50001
                                                                                                              server = SocketServer.TCPServer((self.host, self.portUS), UltrasonicHandler)
                                                                                                              server.serve_forever()
                                                                                                      
                                                                                                          def startVideoServer(self):
                                                                                                              # Create the video server, binding to localhost on port 50002
                                                                                                              server = SocketServer.TCPServer((self.host, self.portCam), VideoStreamHandler)
                                                                                                              server.serve_forever()
                                                                                                      
                                                                                                          def start(self):
                                                                                                              ultrasonic_thread = threading.Thread(target=self.startUltrasonicServer)
                                                                                                              ultrasonic_thread.daemon = True
                                                                                                              ultrasonic_thread.start()
                                                                                                              self.startVideoServer()
                                                                                                      
                                                                                                      
                                                                                                      if __name__ == "__main__":
                                                                                                      
                                                                                                          #From SocketServer documentation
                                                                                                          HOST, PORTUS, PORTCAM = '192.168.0.18', 50001, 50002
                                                                                                          sdc = Self_Driver_Server(HOST, PORTUS, PORTCAM)
                                                                                                      
                                                                                                          sdc.start()
                                                                                                      

                                                                                                      video_client.py

                                                                                                      import socket
                                                                                                      import time
                                                                                                      import cv2
                                                                                                      
                                                                                                      
                                                                                                      client_sock = socket.socket()
                                                                                                      client_sock.connect(('192.168.0.18', 50002))
                                                                                                      #We are going to 'write' to a file in 'binary' mode
                                                                                                      conn = client_sock.makefile('wb')
                                                                                                      
                                                                                                      try:
                                                                                                          cap = cv2.VideoCapture(0)
                                                                                                          cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH,320)
                                                                                                          cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT,240)
                                                                                                      
                                                                                                          start = time.time()
                                                                                                      
                                                                                                          while(cap.isOpened()):
                                                                                                              conn.flush()
                                                                                                              ret, frame = cap.read()
                                                                                                              byteImage = frame.tobytes()
                                                                                                              conn.write(byteImage)
                                                                                                      
                                                                                                      
                                                                                                      finally:
                                                                                                          finish = time.time()
                                                                                                          cap.release()
                                                                                                          client_sock.close()
                                                                                                          conn.close()
                                                                                                      

                                                                                                      ANSWER

                                                                                                      Answered 2018-Aug-19 at 20:59

                                                                                                      You can't just display every received buffer of 1-1024 bytes as an image; you have to concatenate them up and only display an image when your buffer is complete.

                                                                                                      If you know, out of band, that your images are going to be a fixed number of bytes, you can do something like this:

                                                                                                      IMAGE_SIZE = 320*240*3
                                                                                                      
                                                                                                      def handle(self):
                                                                                                          stream_bytes = b''
                                                                                                      
                                                                                                          try:
                                                                                                              stream_bytes += self.rfile.read(1024)
                                                                                                              while len(stream_bytes) >= IMAGE_SIZE:
                                                                                                                  image = np.frombuffer(stream_bytes[:IMAGE_SIZE], dtype="B")
                                                                                                                  stream_bytes = stream_bytes[IMAGE_SIZE:]
                                                                                                                  print(image.shape)
                                                                                                                  cv2.imshow('F', image)
                                                                                                                  cv2.waitKey(0)
                                                                                                          finally:
                                                                                                              cv2.destroyAllWindows()
                                                                                                              sys.exit()
                                                                                                      

                                                                                                      If you don't know that, you have to add some kind of framing protocol, like sending the frame size as a uint32 before each frame, so the server can know how many bytes to received for each frame.

                                                                                                      Next, if you're just sending the raw bytes, without any dtype or shape or order information, you need to embed the dtype and shape information into the server. If you know it's supposed to be, say, bytes in C order in a particular shape, you can do that manually:

                                                                                                      image = np.frombuffer(stream_bytes, dtype="B").reshape(320, 240, 3)
                                                                                                      

                                                                                                      … but if not, you have to send that information as part of your framing protocol as well.

                                                                                                      Alternatively, you could send a pickle.dumps of the buffer and pickle.loads it on the other side, or np.save to a BytesIO and np.load the result. Either way, that includes the dtype, shape, order, and stride information as well as the raw bytes, so you don't have to worry about it.

                                                                                                      The next problem is that you're exiting as soon as you display one image. Is that really what you want? If not… just don't do that.

                                                                                                      But that just raises another problem. Do you really want to block the whole server with that cv.waitKey? Your client is capturing images and sending them as fast as it can; surely you either want to make the server display them as soon as they arrive, or change the design so the client only sends frames on demand. Otherwise, you're just going to get a bunch of near-identical frames, then a many-seconds-long gap while the client is blocked waiting for you to drain the buffer, then repeat.

                                                                                                      Source https://stackoverflow.com/questions/51921631

                                                                                                      QUESTION

                                                                                                      docker run Error: Can't find python executable to run
                                                                                                      Asked 2018-Jul-04 at 05:54

                                                                                                      I am running a community edition of Docker (Version 18.03.1-ce-win65 (17513)) on Win10 with Linux containers option. I am building an image using docker locally on Windows, and pushing it to Portus, and finally accessing it to run from HPC running Linux using Putty. Well, it turns out that I am unable to run an instance of the created image because of the following error:

                                                                                                      python: can't open file './Turn.py': [Errno 2] No such file or directory

                                                                                                      This is my Dockerfile that I am using to build an image

                                                                                                      FROM python:3.6
                                                                                                      LABEL version="1.0"
                                                                                                      LABEL build_date="xxx"
                                                                                                      LABEL description="xxx"
                                                                                                      COPY requirements.txt /
                                                                                                      RUN pip install -r requirements.txt
                                                                                                      ENV PYTHONIOENCODING UTF-8
                                                                                                      # Set the default directory where CMD will execute on HPC
                                                                                                      WORKDIR /turn
                                                                                                      COPY Turn.py /Turn.py
                                                                                                      CMD ["python", "./Turn.py"]
                                                                                                      

                                                                                                      The build process completes successfully as indicated here:

                                                                                                      Sending build context to Docker daemon   12.8kB
                                                                                                      Step 1/13 : FROM python:3.6
                                                                                                       ---> 5f87764f9df0
                                                                                                      Step 2/13 : LABEL maintainer="xxx"
                                                                                                       ---> Using cache
                                                                                                       ---> 71cd96de7015
                                                                                                      Step 3/13 : LABEL version="1.0"
                                                                                                       ---> Using cache
                                                                                                       ---> 2fc5cdab38a9
                                                                                                      Step 4/13 : LABEL build_date="xxx"
                                                                                                       ---> Using cache
                                                                                                       ---> ae488b87a931
                                                                                                      Step 5/13 : LABEL description="xxx"
                                                                                                       ---> Using cache
                                                                                                       ---> cb11a0cf08a2
                                                                                                      Step 6/13 : COPY requirements.txt /
                                                                                                       ---> Using cache
                                                                                                       ---> 5ec08f42d1f7
                                                                                                      Step 7/13 : RUN pip install -r requirements.txt
                                                                                                       ---> Using cache
                                                                                                       ---> dfa45323647a
                                                                                                      Step 8/13 : ENV PYTHONIOENCODING UTF-8
                                                                                                       ---> Using cache
                                                                                                       ---> 733907694a25
                                                                                                      Step 9/13 : ENV http_proxy="http://xxx"
                                                                                                       ---> Using cache
                                                                                                       ---> 9b0ba73057ae
                                                                                                      Step 10/13 : ENV https_proxy="https://xxx"
                                                                                                       ---> Using cache
                                                                                                       ---> e1ea75915df8
                                                                                                      Step 11/13 : WORKDIR /turn
                                                                                                       ---> Using cache
                                                                                                       ---> a8b8ad69d82c
                                                                                                      Step 12/13 : COPY Turn.py /Turn.py
                                                                                                       ---> Using cache
                                                                                                       ---> 9f9cb068c16b
                                                                                                      Step 13/13 : CMD ["python", "./Turn.py"]
                                                                                                       ---> Using cache
                                                                                                       ---> a7f10949e521
                                                                                                      Successfully built a7f10949e521
                                                                                                      Successfully tagged turn:latest
                                                                                                      

                                                                                                      SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.

                                                                                                      I am trying to run this image using the following command:

                                                                                                      f@hpclogin1:~> docker run hpcdocker.hpc.xxx.com:5000/namespace/turn:latest 
                                                                                                      

                                                                                                      python: can't open file './Turn.py': [Errno 2] No such file or directory

                                                                                                      ANSWER

                                                                                                      Answered 2018-Jul-04 at 05:54

                                                                                                      This should be a simple path issue. Notice how you call python on ./turn.py? This means you will assume it is a child of the current directory, which is - depending on your entrypoint - not necessarily the root folder where you copied it to.

                                                                                                      Simply changing your call CMD ["python", "./Turn.py"] CMD ["python", "/Turn.py"] should resolve the issue.

                                                                                                      Source https://stackoverflow.com/questions/51166581

                                                                                                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                                      Vulnerabilities

                                                                                                      No vulnerabilities reported

                                                                                                      Install Portus

                                                                                                      You can download it from GitHub.
                                                                                                      On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

                                                                                                      Support

                                                                                                      There are multiple ways of setting up a development environment. We recommend using docker-compose, so you only need to perform:.
                                                                                                      Find more information at:
                                                                                                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                                      Find more libraries
                                                                                                      Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                                      Save this library and start creating your kit
                                                                                                      CLONE
                                                                                                    • HTTPS

                                                                                                      https://github.com/SUSE/Portus.git

                                                                                                    • CLI

                                                                                                      gh repo clone SUSE/Portus

                                                                                                    • sshUrl

                                                                                                      git@github.com:SUSE/Portus.git

                                                                                                    • Share this Page

                                                                                                      share link

                                                                                                      Explore Related Topics

                                                                                                      Reuse Pre-built Kits with Portus

                                                                                                      Consider Popular Continuous Deployment Libraries

                                                                                                      Try Top Libraries by SUSE

                                                                                                      DeepSea

                                                                                                      by SUSEPython

                                                                                                      machinery

                                                                                                      by SUSERuby

                                                                                                      skuba

                                                                                                      by SUSEGo

                                                                                                      phoebe

                                                                                                      by SUSEC

                                                                                                      Compare Continuous Deployment Libraries with Highest Support

                                                                                                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                                      Find more libraries
                                                                                                      Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                                      Save this library and start creating your kit