-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial GCC container for Cpp, need to surpress request for port * Adding test * Initial GCC container for Cpp, need to surpress request for port * Adding test * Missed updated platform.ts * Changing port to undefined so it doesn't prompt * Changed name to C++, fixed tests * removing unused type Unneeded type, already using PlatformOS from platform.ts * Removing another duplication... * Fixing lint error
- Loading branch information
1 parent
bf20b5a
commit df5dcc5
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See LICENSE.md in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { getExposeStatements, IPlatformGeneratorInfo, PackageInfo } from './configure'; | ||
|
||
export let configureCpp: IPlatformGeneratorInfo = { | ||
genDockerFile, | ||
genDockerCompose: undefined, // We don't generate compose files for Cpp | ||
genDockerComposeDebug: undefined, // We don't generate compose files for Cpp | ||
defaultPort: undefined // We don't open a port for Cpp | ||
}; | ||
|
||
function genDockerFile(serviceNameAndRelativePath: string, platform: string, os: string | undefined, port: string, { cmd, author, version, artifactName }: Partial<PackageInfo>): string { | ||
let exposeStatements = getExposeStatements(port); | ||
|
||
return `# GCC support can be specified at major, minor, or micro version | ||
# (e.g. 8, 8.2 or 8.2.0). | ||
# See https://hub.docker.com/r/library/gcc/ for all supported GCC | ||
# tags from Docker Hub. | ||
# See https://docs.docker.com/samples/library/gcc/ for more on how to use this image | ||
FROM gcc:latest | ||
# These commands copy your files into the specified directory in the image | ||
# and set that as the working location | ||
COPY . /usr/src/myapp | ||
WORKDIR /usr/src/myapp | ||
# This command compiles your app using GCC, adjust for your source code | ||
RUN g++ -o myapp main.cpp | ||
# This command runs your application, comment out this line to compile only | ||
CMD ["./myapp"] | ||
LABEL Name=${serviceNameAndRelativePath} Version=${version} | ||
`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ export type Platform = | |
'Node.js' | | ||
'Python' | | ||
'Ruby' | | ||
'C++' | | ||
'Other'; |