Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

dockerHostUri didn't work #366

Open
steven-dai opened this issue Oct 29, 2020 · 3 comments
Open

dockerHostUri didn't work #366

steven-dai opened this issue Oct 29, 2020 · 3 comments
Labels

Comments

@steven-dai
Copy link

steven-dai commented Oct 29, 2020

I referred to this address
my plugin info:

                        <plugin>
				<groupId>com.spotify</groupId>
				<artifactId>dockerfile-maven-plugin</artifactId>
				<version>1.4.13</version>
				<executions>
					<execution>
						<id>default</id>
						<goals>
							<goal>build</goal>
							<goal>push</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<dockerHostUri>http://39.101.163.100:2375</dockerHostUri>
					<!-- dockerfile文件路径 -->
					<contextDirectory>./</contextDirectory>
					<!-- 镜像地址 -->
					<repository>${docker.registry}/demo</repository>
					<!-- 不指定tag默认为latest -->
					<tag>${project.version}</tag>
					<!-- 构建参数,可以传递给Dockerfile -->
					<buildArgs>
						<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
					</buildArgs>
				</configuration>
			</plugin>

when I exec DOCKER_HOST=http://39.101.163.100:2375 mvn clean package , it's ok!
when I exec mvn clean package ,it's error!
十月 29, 2020 5:08:51 下午 com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute
信息: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory

I want to add 'DOCKER_HOST' in my pom.xml,What should I do?Thanks

@GauravBhandari19
Copy link

Did you get any answer for it? I was under impression that you cannot define DOCKER_HOST in POM.xml and used by env config of the docker client, but it would be cool if we could define it in pom.xml (LIke the spotify/docker-maven-plugin).

@zlcolin
Copy link

zlcolin commented Dec 19, 2020

DOCKER_HOST=http://xxx.xxx.253.62:2375 mvn clean package dockerfile:build it's ok.
export DOCKER_HOST=tcp://xxx.xxx.253.62:2375
mvn clean package dockerfile:build but it's fail, not pass on image to docker host, why?

@stale
Copy link

stale bot commented Jan 9, 2022

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

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants