Open prateeumich opened 7 months ago
Hi @prateeumich of course, you can do whatever you want in a Dockerfile.
Can you share what do you have so far?
What programming language are you trying to use? Python?
this is my dockerfile
**FROM ghcr.io/openfaas/classic-watchdog:0.2.3 as watchdog
FROM tensorflow/tensorflow:latest-gpu
RUN mkdir -p /home/app
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog
RUN groupadd -r app && useradd -r -g app app
RUN chown app /home/app COPY program.py .
WORKDIR /home/app
USER app
ENV fprocess="cat"
ENV write_debug="false"
EXPOSE 8080
HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1
CMD ["fwatchdog"]**
I have written a matmul program using tensorflow and python
import tensorflow as tf
# Check if GPU is available
if tf.test.is_gpu_available():
print("GPU is available")
else:
print("GPU is NOT available")
# Define a simple TensorFlow computation graph
a = tf.constant(3.0)
b = tf.constant(4.0)
c = tf.add(a, b)
# Create a TensorFlow session
with tf.Session() as sess:
# Execute the computation graph
result = sess.run(c)
print("Result:", result)
I was able to up the function but when I was invoking the function there was no output in the command line
Also, when is the copy step correct or is it why it isn't running the program?
My actions before raising this issue
Why do you need this?
Who is this for?
What company is this for? Are you listed in the ADOPTERS.md file?
Expected Behaviour
Current Behaviour
I am trying to install tensorflow inside the docker container, is it possible to use a tensorflow base image or no? I can see we are only using alpine linux as the base image
Are you a GitHub Sponsor (Yes/No?)
NO Check at: https://github.com/sponsors/openfaas
List All Possible Solutions and Workarounds
Which Solution Do You Recommend?
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context
## Your EnvironmentFaaS-CLI version ( Full output from:
faas-cli version
): version: 0.16.23Docker version
docker version
(e.g. Docker 17.0.05 ): Docker version 26.0.0Are you using OpenFaaS on Kubernetes or faasd? Yes using it on Minikube
Operating System and version (e.g. Linux, Windows, MacOS): Linux Ubuntu 22.0.4
Code example or link to GitHub repo or gist to reproduce problem:
Other diagnostic information / logs from troubleshooting guide