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

Unable to build docker image with the given file. #20

Open
abcool opened this issue May 1, 2022 · 0 comments
Open

Unable to build docker image with the given file. #20

abcool opened this issue May 1, 2022 · 0 comments

Comments

@abcool
Copy link

abcool commented May 1, 2022

                     <plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<configuration>
				<image>
					<name>in28min/master-MS-${project.artifactId}:${project.version}</name>
				</image>
				<pullPolicy>IF_NOT_PRESENT</pullPolicy>
			</configuration>
		</plugin>

The above configuration doesn't work.
Had to google search a lot.
Used older method to create docker image as below:

                   <plugin>
			<groupId>com.spotify</groupId>
			<artifactId>dockerfile-maven-plugin</artifactId>
			<!-- version>1.4.0</version-->
			<configuration>
				<repository>abcoolynr/${project.artifactId}</repository>
				<tag>${project.version}</tag>
				<buildArgs>
					<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
				</buildArgs>
			</configuration>
			<executions>
				<execution>
					<id>default</id>
					<phase>install</phase>
					<goals>
						<goal>build</goal>
						<goal>push</goal>
					</goals>
				</execution>
			</executions>
		</plugin>

push fails with this older method as well but at least the docker image gets created.

Please check your code and update it at intervals. Just making tutorials and dumping them on students is not good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant