incalculable-thailand-44404
04/13/2022, 12:24 AM> [2/2] COPY ./abc/abc_bin.jar app.jar:
------
failed to compute cache key: "./abc/abc_bin.jar" not found: not found
when trying to build a docker image with Pulumi. My DockerFile (ExampleProject/abc/DockerFile
)looks like this :
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=./abc/abc_bin.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
My top level Bazel project is named ExampleProject
under which I have abc
as follows : ExampleProject/abc
. When I run bazel build //abc/...
from ExampleProject
it creates a new directory called /ExampleProject/bazel-bin/abc
which has all the jars including abc_bin.jar
able-train-72108
04/13/2022, 12:27 AMincalculable-thailand-44404
04/13/2022, 12:28 AMconst repo2 = new aws.ecr.Repository("ecr_trial");
export const imageName = repo2.repositoryUrl;
const registryInfo = repo2.registryId.apply(async id => {
const credentials = await aws.ecr.getCredentials({ registryId: id });
const decodedCredentials = Buffer.from(credentials.authorizationToken, "base64").toString();
const [username, password] = decodedCredentials.split(":");
if (!password || !username) {
throw new Error("Invalid credentials");
}
return {
server: credentials.proxyEndpoint,
username: username,
password: password,
};
});
// Build and publish the container image.
const image = new docker.Image("my-image", {
build: {
context : "/Users/.../ExampleProject",
dockerfile: "/Users/.../ExampleProject/abc/Dockerfile",
},
registry: registryInfo,
imageName : pulumi.interpolate`${imageName}:v0.0.1`,
});
ExamplProject
)codebase..little-cartoon-10569
04/13/2022, 12:32 AMjava -jar /app.jar
.incalculable-thailand-44404
04/13/2022, 12:32 AMlittle-cartoon-10569
04/13/2022, 12:32 AMincalculable-thailand-44404
04/13/2022, 12:33 AMCOPY ${JAR_FILE} app.jar
, it workslittle-cartoon-10569
04/13/2022, 12:34 AMincalculable-thailand-44404
04/13/2022, 12:34 AMlittle-cartoon-10569
04/13/2022, 12:35 AM${JAR_FILE}
doesn't exist. Can you confirm that it does or does not?able-train-72108
04/13/2022, 12:35 AM/ExampleProject/bazel-bin/abc
" then you should change ARG JAR_FILE=./abc/abc_bin.jar to ARG JAR_FILE=./bazel-bin/abc/abc_bin.jarincalculable-thailand-44404
04/13/2022, 12:37 AM> [2/2] COPY ./bazel-bin/abc/abc_bin.jar app.jar:
------
failed to compute cache key: "/bazel-bin/abc/abc_bin.jar" not found: not found
able-train-72108
04/13/2022, 12:41 AMincalculable-thailand-44404
04/13/2022, 12:46 AMExampleProject
:
docker build -t <http://12334.dkr.ecr.us-west-2.amazonaws.com/abc-staging-520a243:0.0.3|12334.dkr.ecr.us-west-2.amazonaws.com/abc-staging-520a243:0.0.3> -f abc/Dockerfile ./bazel-bin
able-train-72108
04/13/2022, 12:48 AMincalculable-thailand-44404
04/13/2022, 12:53 AMable-train-72108
04/13/2022, 12:57 AMincalculable-thailand-44404
04/13/2022, 12:58 AMable-train-72108
04/13/2022, 12:59 AMincalculable-thailand-44404
04/13/2022, 1:06 AMexport interface DockerBuild {
/**
* context is a path to a directory to use for the Docker build context, usually the directory
* in which the Dockerfile resides (although dockerfile may be used to choose a custom location
* independent of this choice). If not specified, the context defaults to the current working
* directory; if a relative path is used, it is relative to the current working directory that
* Pulumi is evaluating.
*/
context?: pulumi.Input<string>;....
}
ExampleProject/abc
usually the directory
* in which the Dockerfile resides
--platform linux/amd64
while creating a docker build inside Pulumi ?able-train-72108
04/14/2022, 11:08 AM//
// Summary:
// An optional catch-all list of arguments to provide extra CLI options to the docker
// build command. For example `{'--network', 'host'}`.
[Input("extraOptions", false, false)]
public InputList<string>? ExtraOptions