docker: invalid reference format. See 'docker run --help' - deep-learning

I am trying to serving my model using TensorFlow with docker. I downloaded Docker for windows and tried the code as per the documentation.
!docker pull tensorflow/serving
!git clone https://github.com/tensorflow/serving
TESTDATA="/serving/tensorflow_serving/servables/tensorflow/testdata"
Above code worked fine .But when i tried below code
!docker run -t --rm -p 8501:8501,-v "TESTDATA/saved_model_half_plus_two_cpu:/models/half_plus_two",-e MODEL_NAME=half_plus_two,tensorflow/serving
It is giving below error.
docker: invalid reference format.See 'docker run --help'..
Any idea guys please help.

#BSP This worked for me:
docker run -t --rm -p 8501:8501 -v "$testdata/saved_model_half_plus_two_cpu:/models/half_plus_two" -e "MODEL_NAME=half_plus_two" tensorflow/serving

Related

docker run mysql images but it terminate automaticly

I'm just using docker for first time and I copy it on the internet
This is my file
Dockerfile
FROM mysql:oracle
COPY dbscript.sql /docker-entrypoint-initdb.d/
and I build it with this command
docker build -t mysqllab
after built I run it
docker run -d --name mysqllabtest -e MYSQL_ROOT_PASSWORD='abc123' mysqllab
it's run and get the message of container id, so I run
docker ps
to see what my container is running but it's don't have this container, I try it again with fast docker ps so I see it run for 4 seconds and terminate
What Can I do with this?
I just use
docker logs mysqllabtest
for check something wrong it about MySQL script so after I edited it It's works! thanks #Hans Kilian for tell me this command

Docker MySQL: "docker run" requires at least 1 argument

I'm following this guide to use MySQL 8.0 in Docker (on macOS host), but I'm having some issues. I have no Docker experience other than this, so please be easy on me. I tried to debug as best I could. It seems the author of the guide has some outdated commands/syntax errors (not sure which), which I think I've fixed. However, when I try to run the following command, I keep getting the error below:
Command:
docker run --restart always --name mysql8.0 --network dev-network -v /Users/[my-name]/mysql/data/8.0:/var/lib/mysql -p 3306:3308 -d -e MYSQL_ROOT_PASSWORD=[my-password] mysql:8.0
( [my-name] and [my-password] are subbed out).
Error:
"docker run" requires at least 1 argument.
I've checked docker run --help but can't get any further.
I've also found this question and this question, but those cases seem highly specific to the OPs' situation, so the answers didn't yield any successful results for me.
Any help or suggestions are appreciated.
The command you've pasted works fine. There is a possibility that the password you're entering has some special characters making the shell think of it as something else. (Or your volume next to -v flag has some special characters).
Just to test, try with a simple password like this:
docker run --restart always --name mysql8.0 --network dev-network -v /Users/[yourusername]/mysql/data/8.0:/var/lib/mysql -p 3306:3308 -d -e MYSQL_ROOT_PASSWORD=testpass
mysql:8.0

Docker: Error while creating a container with volume

I'm trying to create a simple mysql container, but I'm getting an error.
I created a Dockerfile:
FROM mysql
ENV MYSQL_ROOT_PASSWORD <password>
I built the image:
docker build -t mysql-image -f api/db/Dockerfile .
But when I tried to create a container with a host volume, an error appears:
docker run -d -v $(pwd)/api/db/data:/var/lib/mysql --rm --name mysql-container mysql-image
docker: Error response from daemon: pull access denied for de, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
If I run the same command, but without the volume parameters, then the container is created without any errors:
docker run -d --rm --name mysql-container mysql-image
I appreciate any help
Do you have whitespace in your current path? If so, it may be confusing the $(pwd) as two or more separate parameters. Try wrapping the whole parameter to -v in double quotes.
docker run -d -v "$(pwd)/api/db/data:/var/lib/mysql" --rm --name mysql-container mysql-image

How to make mysql and php work together and without show the database password

start mysql container
$ docker run --name mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql
Connect to MySQL and manually create new database
$ docker run -it --link mysql:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
link the database and start php container
$ docker run -d --link mysql:mysql --name myapp -v "$PWD":/var/www/html -p 80:80 php:5.6-apache
first question:
When access my php website: http://localhost/index.php, I got below error:
Fatal Error: Mysql is not supported in your PHP, recompile and try again.
Here is the configure command shows in phpinfo page, seems mysql module has been included in compile.
Configure Command './configure' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--with-apxs2' '--disable-cgi' '--enable-mysqlnd' '--with-curl' '--with-openssl' '--with-readline' '--with-recode' '--with-zlib'
Are there anything missed in official php image?
second question:
When access http://localhost/info.php, I can see phpinfo page.
But it also shows database password in session "Environment":
MYSQL_ENV_MYSQL_ROOT_PASSWORD my-secret-pw
and in session "PHP Variables"
_ENV["MYSQL_ENV_MYSQL_ROOT_PASSWORD"] my-secret-pw
So how to hide the password in phpinfo()?
I assume you're trying to run phplist in a docker environment.
The message you're seeing (Fatal Error: Mysql is not supported in your PHP, recompile and try again.) is a phplist error message hardcoded in both the ./admin/mysql.inc and ./admin/mysqli.inc files.
This message is displayed upon check for the mysql_connect and mysqli_connect functions being present. You are seeing this message because the functions are not present in your environment.
You have to find out what package offers this functionality and either install it on your docker image, or build a new docker image with this support present.
The official PHP docker image is based on Debian, which offers the php5-mysql package. This is not present in the docker image, so you install this package using apt-get, then use docker-php-ext-install, docker-php-ext-configure and docker-php-ext-enable to enable the mysql and mysqli extensions.

How do I test an IronWorker task locally using the CLI?

How do I test an IronWorker task locally using the CLI?
iron_worker run worker_name -p '{"foo":"bar","baz":[1,2,3]}'
where optional "-p" flag - payload
Assuming you have Docker installed you can also run your worker locally using a Docker command:
$ docker run --rm -v "$(pwd)":/worker -w /worker iron/php sh -c 'php name_of_worker.php'
Just make sure your Docker Quickstart Terminal is up and running.
If it works on Docker then it will work on IronIO. As stated in the Iron docs here.