Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the "Remote" arg in the BuildImageOptions may cause the io error #976

Closed
Ivanbeethoven opened this issue Apr 10, 2023 · 1 comment
Closed
Labels

Comments

@Ivanbeethoven
Copy link

this is my code demo

	opts := docker.BuildImageOptions{
		Name: "test",
		OutputStream: _log,
		Remote:       "http://127.0.0.1:8000/docker/Dockerfile",
		ContextDir: "/home/springboot_test0",
	}
	if err := client.BuildImage(opts); err != nil {
		log.Fatal(err)
		print(err)
	}

and here is the output :

time="2023-04-10T17:21:20+08:00" level=error msg="Can't add file /home/*****/target/springboot_for_test-0.0.1-SNAPSHOT.jar to tar: io: read/write on closed pipe"
time="2023-04-10T17:21:20+08:00" level=error msg="Can't close tar writer: io: read/write on closed pipe"
--- PASS: TestDockerbuild (0.08s)
PASS

here is the Dockerfile

FROM openjdk:8-jre

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

ADD ./target/springboot_for_test-0.0.1-SNAPSHOT.jar /app/
CMD ["java", "-Xmx200m",  "-jar", "/app/springboot_for_test-0.0.1-SNAPSHOT.jar"]
EXPOSE 8080

I make sure all the path and uri is correct
If i put the Dockerfile in the project contextDir and delete “Remote” , that will build the docker image successfully.
I would greatly appreciate it if you could point out my mistake

@stale
Copy link

stale bot commented May 29, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 29, 2023
@stale stale bot closed this as completed Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant