Skip to content

Native OS dependencies using dockerFile not working #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Rahulnigam28 opened this issue Apr 28, 2019 · 2 comments
Open

Native OS dependencies using dockerFile not working #357

Rahulnigam28 opened this issue Apr 28, 2019 · 2 comments
Labels
Docker waiting-on-response If an issue goes without response for a while, close it.

Comments

@Rahulnigam28
Copy link

Rahulnigam28 commented Apr 28, 2019

I am trying to build serverless.yml using custom dockerfile. However, when I do sls deploy it does not recognize that docker file and shows warning (dockerizePip is set to false)
Warning: You provided a docker related option but dockerizePip is set to false.

My sls version is 1.4.1
serverless-python-requirements version is 4.3.0

1.) Not using dockerizePip: True in serverless.yml
custom:
pythonRequirements:
dockerFile: myDockerfile.Dockerfile

Note: requirements.txt is not present

sls deploy -s dev results in . " Warning: You provided a docker related option but dockerizePip is set to false"

2.) Adding dockerizePip: True in serverless.yml

custom:
pythonRequirements:
dockerizePip: True
dockerFile: myDockerfile.Dockerfile

Note: requirements.txt is not present
Results in no warning but also dont get any message "Building custom docker image from myDockerfile.Dockerfile"

3.) serverless.yml same as above and created an empty requirements.txt

Output: During sls deploy, although I see the message "Building custom docker image from myDockerfile.Dockerfile". My Lambda function does not have that OS depencies installed inside it .

@jdufresne
Copy link
Contributor

My Lambda function does not have that OS depencies installed inside it .

Installing OS dependencies in the Docker image does not also install them in the Lambda function. You may be interested in PR #366, which I think is one step towards what you may need.

@AndrewFarley
Copy link
Contributor

It sounds like this bug author doesn't quite understand what role this plugin plays and what role docker plays in regards to this plugin. Docker is just a virtualized OS used to collect the requirements to prepare for packaging. If you have no requirements file it won't have anything to do, and so we catch that issue to help the user understand they are not doing something right (1 and 2 above). In regards to 3, @jdufresne clarified that you can achieve what you're trying to do by using the native-code-dependencies-during-runtime feature with an empty requirements.txt file.

Effectively, @Rahulnigam28 what you're describing that you are trying to do is to use this plugin as a gateway to run Docker and gather files which you inject into your package. Which, through the above link I specified is possible, but it's not the primary reason for this package's purpose. Recommending to close this bug.

@AndrewFarley AndrewFarley added the waiting-on-response If an issue goes without response for a while, close it. label Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docker waiting-on-response If an issue goes without response for a while, close it.
Projects
None yet
Development

No branches or pull requests

4 participants