sparse-intern-71089
04/13/2022, 12:24 AMable-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`,
});
incalculable-thailand-44404
04/13/2022, 12:29 AMExamplProject
)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.jarable-train-72108
04/13/2022, 12:36 AMincalculable-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 AMable-train-72108
04/13/2022, 12:49 AMincalculable-thailand-44404
04/13/2022, 12:53 AMincalculable-thailand-44404
04/13/2022, 12:56 AMable-train-72108
04/13/2022, 12:57 AMincalculable-thailand-44404
04/13/2022, 12:58 AMable-train-72108
04/13/2022, 12:59 AMable-train-72108
04/13/2022, 1:00 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>;....
}
incalculable-thailand-44404
04/13/2022, 1:07 AMExampleProject/abc
usually the directory
* in which the Dockerfile resides
incalculable-thailand-44404
04/13/2022, 9:19 PM--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