failed to create LLB definition: dockerfile parse error line 1: FROM requires either one or three arguments - dockerfile

I am getting the below error while creating a docker image of a sample spring boot application. This is my first attempt to create an image and I am completely new to it and have no clue why I am getting this error. Please help
Error : failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 1: FROM requires either one or three arguments
My Dockerfile contains the below code:
FROM openjdk:11
ADD target/docker-spring-boot.jar docker-spring-boot.jar
EXPOSE 8085
ENTRYPOINT ["java", "-jar", "docker-spring-boot.jar"]

Related

gcloud run deploy ERROR: (gcloud.run.deploy) Invalid value for [source]: Dockerfile required when specifying --tag

I was trying to deploy to CloudRun for the first time by following instruction on a blog (By Tom Ray : Deploying a NestJS app to Cloud Run with Github Actions).
In the section "Use gcloud run deploy", when giving the command gcloud run deploy I got this unclear error message:
Deployment failed
ERROR: (gcloud.run.deploy) Invalid value for [source]: Dockerfile required when specifying --tag
Searching the web I could not find an answer or hint to explain the error message.
After moving on to another tutorial I understood what my mistake was.
It was a simple "case sensitive" syntax error naming of the docker file.
I named it "dockerfile" and it should have been named "Dockerfile".
This is a unique naming convention from all the other filenames in the project, they are either all lowercase or all uppercase.
A better error message would have been "ERROR: Missing Dockerfile", that would have been enough for me to find the cause.

Creating docker image from postgresql but failed.\

failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount318724744/Dockerfile: no such file or directory
I'm just trying to build an image using sql but there is an error enter image description here
I'm unable to find a way
My Dockerfile code is:
FROM postgres:10-alphine
ADD sql/setup.sql/docker-entrypoint-initdb.d/
can anyone resolve my issue??

Docker executable not found in PATH when using AWS batch/ECS

I am trying to run a simple Dockerized Python script with AWS batch.
Is there a problem with my Docker image?
I have locally built the Docker image and it runs fine locally. I pushed the image to a AWS repository, and pulling this remote image to my local machine also runs correctly.
Problem
I have setup my compute env, job queue, and job definition, but I get this error
CannotStartContainerError: Error response from daemon:
OCI runtime create failed: container_linux.go:370:
starting container process caused:
exec: "docker": executable file not found in $PATH: unknown
when I run
["docker","run","-t","111111111111.dkr.ecr.us-region-X.amazonaws.com/myimage:latest","python3","hello_world.py","--MSG","ok"]
Is Docker installed?
I am using the ECS_AL2 image type. When I start a EC2 with this AMI and ssh into it, I can see that Docker is already installed. docker run works fine for instance.
Is there a (generic) problem with my compute env, job queue, or job def?
When I instead try to run the command echo hello this works fine.
Appreciate any advice/help you can provide.
UPDATE - ANSWER
#samtoddler helped me to realize that I only needed
["python3","hello_world.py","--MSG","ok"]
in the Command statement
this error
CannotStartContainerError: Error response from daemon:
that means it is coming from docker daemon, so docker is doing its job.
Seems like you have some trouble with your docker image, how it is packaged and how you trying to pass all those vars.
Please check Docker Image CMD section on how to use ENTRYPOINT and CMD.
There is some explanation in this question docker-oci-runtime-create-failed-container-linux-go349-starting-container-pro

AWS: ERROR: Pre-processing of application version xxx has failed and Some application versions failed to process. Unable to continue deployment

Hi I am trying to deploy a node application from cloud 9 to ELB but I keep getting the below error.
Starting environment deployment via CodeCommit
--- Waiting for Application Versions to be pre-processed --- ERROR: Pre-processing of application version app-491a-200623_151654 has
failed. ERROR: Some application versions failed to process. Unable to
continue deployment.
I have attached an image of the IAM roles that I have. Any solutions?
Go to your console and open up your elastic beanstalk console. Go to both applications and environments and delete them. Then in your terminal hit
eb init #Follow instructions
eb create --single ##Follow instructions.
It would fix the error, which is due to some application states which are failed. If you want to check those do
aws elasticbeanstalk describe-application-versions
I was searching for this answer as a result of watching a YouTube tutorial for how to pass the AWS Certified Developer Associate exam. If anyone else gets this error as a result of that tutorial, delete the 002_node_command.config file created in the tutorial and commit that change, as that is causing the error to occur.
A failure within the pre-processing phase, may be caused by an invalid manifest, configuration or .ebextensions file.
If you deploy an (invalid) application version using eb deploy and you enable the preprocess option, The details of the error will not be revealed.
You can remove the --process flag and enable the verbose option to improve error output.
in my case I deploy using this command:
eb deploy -l "XXX" -p
And can return a failure when I mess around with .ebextensions:
ERROR: Pre-processing of application version xxx has failed.
ERROR: Some application versions failed to process. Unable to continue deployment.
With that result I can't figure up what is wrong,
but deploying without -p (or --process)and adding -v (verbose) flag:
eb deploy -l "$deployname" -v
It returns something more useful:
Uploading: [##################################################] 100% Done...
INFO: Creating AppVersion xxx
ERROR: InvalidParameterValueError - The configuration file .ebextensions/16-my_custom_config_file.config in application version xxx contains invalid YAML or JSON.
YAML exception: Invalid Yaml: while scanning a simple key
in 'reader', line 6, column 1:
(... details of the error ...)
, JSON exception: Invalid JSON: Unexpected character (#) at position 0.. Update the configuration file.
Now I can fix the problem.

Unknown or duplicate parameter: NodeCommand

I'm trying to deploy a Node.js API with Elastic beanstalk.
I want to set the node command to start the app.
This is my nodecommand.config:
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "npm start"
This is my file structure:
Whenever I try to run eb deploy, I get this error:
2020-05-13 19:03:44 INFO Environment update is starting.
2020-05-13 19:03:48 ERROR "option_settings" in one of the configuration files failed validation. More details to follow.
2020-05-13 19:03:48 ERROR Unknown or duplicate parameter: NodeCommand
2020-05-13 19:03:48 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
I just encountered this very same issue. Upon investigation I found that "NodeCommand" is the legacy way to run your application with custom commands.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.container.html
I removed the ".ebextensions" directory and added a file called "Procfile" to my source directory.
Inside Procfile, try putting the following:
web: npm start
Make sure you update your repository with these changes if necessary before trying to deploy.
Hope this helps!
I used Procfile to deploy app
in Procfile
web: npm run deploy
In package.json, added new command deploy
"scripts": {
"deploy": "npm run build && npm run start"
},
For those who came here through Google, I had a similar problem and was getting this response:
ERROR: ServiceError - Configuration validation exception: Unknown or duplicate parameter: NodeVersion
After trying a lot of things I learned this is now legacy. I deleted that file and added a ProcFile at the root of my application (file name is case sensitive, there doesn't seem to be a required extension), with this line:
web: npm start
That error disappeared (to be replaced by a different one about role permissions, but any progress is good progress, right?).