Docker image build issue - osx - dockerfile

getting the following error and have not been able to resolve with google search. can someone assist please
macbook pro - monterey 12.6.3
Docker version 20.10.22, build 3a2c30b
compete error below docker build -t webserver .
[+] Building 0.0s (1/2)
=> ERROR [internal] load build definition from Dockerfile a 0.0s
=> transferring dockerfile: 40B 0.0s
i have tried uninstall and reinstall but did not correct the issue
any help is appreciated
i was expecting the image to build

Related

How do I install (anything) on debian: 'apt is unknown instruction' in Dockerfile

How do I install (anything) on debian: 'apt is unknown instruction' in Dockerfile
If I search: [how to install wget on debian]
I get articles that say:
$sudo apt install wget
So I try to do that in Docker:
FROM debain
apt install wget
and I get this error
/full/path/to/current/working/directory
[+] Building 0.1s (2/2) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 102B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 2: unknown instruction:
APT
/full/path/to/current/working/directory
--
what could be the problem here?
You need to add the RUN instruction, like this:
FROM debian
RUN apt install wget

Getting "Error processing tar file(exit status 1): open /myenv/include/python3.6m/Python-ast.h: no such file or directory" while docker-compose build

So I am pretty new to docker and django. Unfortunately while running the below command on my linux machine which i am connected using my physical windows machine using putty:
docker-compose build
I am getting an error:
Error processing tar file(exit status 1): open /myenv/include/python3.6m/Python-ast.h: no such file or directory
'myenv' is the environment I have created inside my folder.
I am getting a container started on port 9000. The app doesn't have anything yet just a simple project so i just expect to see the 'congratulations' screen. I don't know where I am going wrong. My final goal would be to run the docker url in my windows browser and see the screen of docker container.
This is my docker-compose.yml file:
version: '3'
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:9000
ports:
- 202.179.92.106:8000:9000
the IP: 202.179.92.106 is my public IP. I did the above binding so as to access the docker container from my windows machine. Would request additional inputs for the port binding as well if correct/incorrect.
Below is my Dockerfile:
FROM python:3.6.9
RUN mkdir djangotest
WORKDIR djangotest
ADD . /djangotest
RUN pip install -r requirements.txt
Please help me out peeps!
If you have a virtual environment in your normal development tree, you can't copy it into a Docker image. You can exclude this from the build sequence by mentioning it in a .dockerignore file:
# .dockerignore
myenv
Within the Dockerfile, the RUN pip install line will install your application's dependencies into the Docker image, so you should have a complete self-contained image.

why is the serverless framework rust plugin failling in dockerless and dockerised build mode

I am currently building my rust lambda using the dockerless method, it builds and deploys fine but when I attempt to test it throws the error:
Error: fork/exec /var/task/bootstrap: no such file or directory Runtime.InvalidEntrypoint
I then tried building it using a builder image following this method but that when it ran it returned the error
/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /var/task/bootstrap)
The image used for the build is
FROM lambci/lambda:20200812-build-provided.al2
ARG RUST_VERSION=1.51.0
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| CARGO_HOME=/cargo RUSTUP_HOME=/rustup sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION
ADD build.sh /usr/local/bin/
RUN chmod 777 -R /usr/local
VOLUME ["/code"]
WORKDIR /code
ENTRYPOINT ["/usr/local/bin/build.sh"]
Which does have an version of glibc higher that 2.18
At this point I am out of ideas as to what to try next and would really appreciate it if some one could give me any ideas that allow me to deploy my rust lambda functions using the serverless framework
P.s I did originally try using the plugin with it's defaults but its to far out of date to be usefull

unable to create docker image using git bash

Unable to create docker image using git bash (windows 10)
created following Dockerfile
FROM debian:sid
RUN apt-get -y update
RUN apt-get install nano
CMD ["bin/nano", "/tmp/notes"]
$ docker build -t example .
Get Error:
$ docker build -t example .
[+] Building 0.0s (3/3) FINISHED
=> [internal] load build definition from Dockerfile
=> => transferring dockerfile: 31B
=> [internal] load .dockerignore
=> => transferring context: 2B
=> ERROR [internal] load metadata for docker.io/library/debian:sid
------
> [internal] load metadata for docker.io/library/debian:sid:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fdebian%3Apull&service=registry.docker.io: dial tcp 3.211.199.249:443: i/o timeout
steps tried: restart terminal, tried on cmd, restart docker desktop -
no go
please advise, thank you
The error mentions failed to fetch oauth token
Have you tried to run
docker login
in your terminal prior to running the build command?

amazon beans talk docker Failed to build Docker image aws_beanstalk/staging-app not a directory

I want run my Java application in Amazon Beans talk within Docker, I zip Dockerfile, my app and bash script into archive and upload to beanstalk but during build I get error:
Step 2 : COPY run /opt
time="2017-02-07T16:42:40Z" level="info" msg="stat /var/lib/docker/devicemapper/mnt/823f97180373b7f268e72b3a5daf0f965feb2c7aa9d3537cf845a36e2dfac80a/rootfs/opt/run: not a directory"
Failed to build Docker image aws_beanstalk/staging-app: ="info" msg="stat /var/lib/docker/devicemapper/mnt/823f97180373b7f268e72b3a5daf0f965feb2c7aa9d3537cf845a36e2dfac80a/rootfs/opt/run: not a directory" .
On my local computer docker build and run works fine.
My Dockerfile:
FROM ubuntu:14.04
MAINTAINER Dev
COPY run /opt
COPY app.war /opt
EXPOSE 8081
CMD ["/opt/run"]
Thanks for help