Open felixvelariusbos opened 4 years ago
I should note that I'm very new to Docker, so I was partially basing off of https://github.com/ibnesayeed/webserver-tester/blob/master/Dockerfile. Not sure if that's okay or not!
While you have necessary files in the root of your repo, you are not copying them in the Docker image, so they are not available when the container runs. There are two Dockerfile
instructions, COPY and ADD that can be used for this purpose. They both are similar, but have some differences that you can learn about in the Dockerfile best practices guide.
Also, you should actually keep the tar.gz
version of the sample file in your repo then extract it manually for local testing and extract in the Document Root of your server in the Dockerfile
(there is no harm is keeping test files of all the test cases in your document root). While generally there is nothing wrong in keeping extracted files in the repo, except the fact that Git does not track empty folders, which we have for testing certain behaviors, so they will be missing from your repo (and if you were to add a hidden file in empty folders for Git tracking then they won't be empty anymore).
I think you will have better luck if you were to try understanding the Dockerfile and code organization in the https://github.com/ibnesayeed/cs531-webserver repo and take inspiration from it. Let me know if you need more help.
I was able to get it deployed!...almost.
Now, I have a Streaming STDOUT/STDERR logs of
cs531-cheinichserver... standard_init_linux.go:207: exec user process caused "exec format error error
But hey, different error now!
This is pretty easy to fix. You are using your main.py
file as a script and have correctly changed its permissions to make it executable, but have not used a shebang in the file to tell the shell what interpreter should be used to execute this file (note that in Linux file extensions mean nothing generally in situations like these). So, you have two options to fix it:
Either, in your main.py
file, add the follow line at the very top of the file:
#!/usr/bin/env python
Or, explicitly call your script with python
in your Dockerfile
's CMD
:
CMD ["python", "main.py"]
I have also noticed something in your code that should be fixed, the test cases assume that you have a1-test
directory immediately in your document root, not the contents of it. Also, there is no harm in extracting entire sample tar.gz
file there, though Assignment 1 test cases will only test against only one sub-directory. You can find more comments about it in #41.
That fixed the issue, thank you!
As to the other, thank you. I have a few other things to fix at the moment, but I will work on that as well.
We will keep the issues open, so they are easier to access, but I will mark it as resolved.
Hopefully this isn't a tough question and I'm missing something simple, but long story short: Where does the test server deploy the application that's in my git repository?
I wanted to test out what I had, so I tried to deploy it, and I got this error:
That file does exist in the root of my Git repository. I added a
pwd; ls
to the Dockerfile, and it showed me that at least the initial working directory is the root/
, but I couldn't see my webserver code. Thank you!