chalie001
asked on
issue creating image
hi am having this issue when creating custom image
sudo docker image build -t customingx:0.01 /root/
[sudo] password for docker:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /root/Dockerfile: no such file or directory
docker@docker-VirtualBox:~/Documents/images/UBUNTU$
Is there a Dockerfile in /root? I would expect you to use the Dockerfile in the current directory (~/Documents/images/UBUNTU ), so replace "/root/" with ".".
As @simon3270 mentioned, error message seems clear, Docker is unable to find your DockerFile, so creating this file or pointing to the correct path or your DockerFile should fix this problem.
ASKER
am geting
sudo docker image build -t acor:0.01 ..
[sudo] password for docker:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/docker/Documents/Dockerfile: no such file or directory
docker@docker-VirtualBox:~/Documents/images$ ls
Dockerfile UBUNTU
docker@docker-VirtualBox:~/Documents/images$
sudo docker image build -t acor:0.01 ..
[sudo] password for docker:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/docker/Documents/Dockerfile: no such file or directory
docker@docker-VirtualBox:~/Documents/images$ ls
Dockerfile UBUNTU
docker@docker-VirtualBox:~/Documents/images$
Tip: Avoid using relative paths, instead use absolute paths, so debugging is instantaneous.
The command...
Will produce varying results, depending on your CWD (current working directory), when the command is issued.
This makes problems difficult to debug, because you'll always have to consider your CWD as your first debugging step.
The command...
sudo docker image build -t acor:0.01 ..
Will produce varying results, depending on your CWD (current working directory), when the command is issued.
This makes problems difficult to debug, because you'll always have to consider your CWD as your first debugging step.
I see your Dockerfile is in the ~/Documents/images directory. Since you are running the command in that directory, put a singke dot at the end of the command to use the current directory. Two dots means the parent directory
ASKER
ok am geting
sudo docker image build -t acor:0.01 .
[sudo] password for docker:
Sending build context to Docker daemon 4.096kB
Step 1/4 : FROM oraclelinux:8
---> fa4253e97227
Step 2/4 : LABEL version="0.0.1"
---> Running in 45ec7602c0a0
Removing intermediate container 45ec7602c0a0
---> 8d4622b9263d
Step 3/4 : LABEL maitainer="tmymail@gmail.com"
---> Running in 3f851fb829a2
Removing intermediate container 3f851fb829a2
---> 686afcdb1861
Step 4/4 : RUN apt-get update && apt-get upgrade -y
---> Running in 4fb32c4f2a59
/bin/sh: apt-get: command not found
The command '/bin/sh -c apt-get update && apt-get upgrade -y' returned a non-zero code: 127
sudo docker image build -t acor:0.01 .
[sudo] password for docker:
Sending build context to Docker daemon 4.096kB
Step 1/4 : FROM oraclelinux:8
---> fa4253e97227
Step 2/4 : LABEL version="0.0.1"
---> Running in 45ec7602c0a0
Removing intermediate container 45ec7602c0a0
---> 8d4622b9263d
Step 3/4 : LABEL maitainer="tmymail@gmail.com"
---> Running in 3f851fb829a2
Removing intermediate container 3f851fb829a2
---> 686afcdb1861
Step 4/4 : RUN apt-get update && apt-get upgrade -y
---> Running in 4fb32c4f2a59
/bin/sh: apt-get: command not found
The command '/bin/sh -c apt-get update && apt-get upgrade -y' returned a non-zero code: 127
Oracle linux is based on RHEL so uses yum, not apt, for package management
@simon3270 is correct, if you use RHEL or derivative there is no APT subsystem, you'll use yum or install .rpm file directly using rpm.
ASKER
image not created
sudo docker image build -t acor:0.01 .
[sudo] password for docker:
Sending build context to Docker daemon 4.096kB
Step 1/4 : FROM oraclelinux:8
---> fa4253e97227
Step 2/4 : LABEL version="0.0.1"
---> Using cache
---> 8d4622b9263d
Step 3/4 : LABEL maitainer="mymail@gmail.com"
---> Using cache
---> 686afcdb1861
Step 4/4 : RUN yum update
---> Running in 2746acf55cb0
Oracle Linux 8 BaseOS Latest (x86_64) 2.4 MB/s | 41 MB 00:16
Oracle Linux 8 Application Stream (x86_64) 2.3 MB/s | 31 MB 00:13
Last metadata expiration check: 0:00:30 ago on Sun Jan 9 12:37:31 2022.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Upgrading:
openssl-libs x86_64 1:1.1.1k-5.el8_5 ol8_baseos_latest 1.5 M
oraclelinux-release-el8 x86_64 1.0-21.el8 ol8_baseos_latest 21 k
systemd x86_64 239-51.0.1.el8_5.3 ol8_baseos_latest 3.6 M
systemd-libs x86_64 239-51.0.1.el8_5.3 ol8_baseos_latest 1.1 M
systemd-pam x86_64 239-51.0.1.el8_5.3 ol8_baseos_latest 478 k
Transaction Summary
================================================================================
Upgrade 5 Packages
Total download size: 6.6 M
Is this ok [y/N]: Operation aborted.
The command '/bin/sh -c yum update' returned a non-zero code: 1
docker@docker-VirtualBox:~/Documents/images$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 686afcdb1861 19 hours ago 235MB
<none> <none> fd076c4b1601 13 days ago 1.15GB
tshifhiwadocker/react-image latest c9284b9caf0a 13 days ago 21.8MB
<none> <none> 5f8a45a2b498 13 days ago 1.18GB
tshifhiwadocker/calmis-image latest c5724e4cc07b 13 days ago 113MB
<none> <none> 4cf55da08a5c 2 weeks ago 1.18GB
nginx latest f652ca386ed1 5 weeks ago 141MB
node latest 058747996654 5 weeks ago 992MB
openjdk latest 1b3756d6df61 7 weeks ago 471MB
oraclelinux 8 fa4253e97227 7 weeks ago 235MB
hello-world latest feb5d9fea6a5 3 months ago 13.3kB
cndkhuong/oracle19c latest c3175141c9a6 20 months ago 6.51GB
node 10.19 01b816051d34 21 months ago 911MB
openjdk 8-jre-alpine f7a292bbb70c 2 years ago 84.9MB
nginx 1.12-alpine 24ed1c575f81 4 years ago 15.5MB
docker@docker-VirtualBox:~/Documents/images$
sudo docker image build -t acor:0.01 .
[sudo] password for docker:
Sending build context to Docker daemon 4.096kB
Step 1/4 : FROM oraclelinux:8
---> fa4253e97227
Step 2/4 : LABEL version="0.0.1"
---> Using cache
---> 8d4622b9263d
Step 3/4 : LABEL maitainer="mymail@gmail.com"
---> Using cache
---> 686afcdb1861
Step 4/4 : RUN yum update
---> Running in 2746acf55cb0
Oracle Linux 8 BaseOS Latest (x86_64) 2.4 MB/s | 41 MB 00:16
Oracle Linux 8 Application Stream (x86_64) 2.3 MB/s | 31 MB 00:13
Last metadata expiration check: 0:00:30 ago on Sun Jan 9 12:37:31 2022.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Upgrading:
openssl-libs x86_64 1:1.1.1k-5.el8_5 ol8_baseos_latest 1.5 M
oraclelinux-release-el8 x86_64 1.0-21.el8 ol8_baseos_latest 21 k
systemd x86_64 239-51.0.1.el8_5.3 ol8_baseos_latest 3.6 M
systemd-libs x86_64 239-51.0.1.el8_5.3 ol8_baseos_latest 1.1 M
systemd-pam x86_64 239-51.0.1.el8_5.3 ol8_baseos_latest 478 k
Transaction Summary
================================================================================
Upgrade 5 Packages
Total download size: 6.6 M
Is this ok [y/N]: Operation aborted.
The command '/bin/sh -c yum update' returned a non-zero code: 1
docker@docker-VirtualBox:~/Documents/images$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> 686afcdb1861 19 hours ago 235MB
<none> <none> fd076c4b1601 13 days ago 1.15GB
tshifhiwadocker/react-image latest c9284b9caf0a 13 days ago 21.8MB
<none> <none> 5f8a45a2b498 13 days ago 1.18GB
tshifhiwadocker/calmis-image latest c5724e4cc07b 13 days ago 113MB
<none> <none> 4cf55da08a5c 2 weeks ago 1.18GB
nginx latest f652ca386ed1 5 weeks ago 141MB
node latest 058747996654 5 weeks ago 992MB
openjdk latest 1b3756d6df61 7 weeks ago 471MB
oraclelinux 8 fa4253e97227 7 weeks ago 235MB
hello-world latest feb5d9fea6a5 3 months ago 13.3kB
cndkhuong/oracle19c latest c3175141c9a6 20 months ago 6.51GB
node 10.19 01b816051d34 21 months ago 911MB
openjdk 8-jre-alpine f7a292bbb70c 2 years ago 84.9MB
nginx 1.12-alpine 24ed1c575f81 4 years ago 15.5MB
docker@docker-VirtualBox:~/Documents/images$
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.