-
Notifications
You must be signed in to change notification settings - Fork 524
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
Adding C++ template #644
Merged
Merged
Adding C++ template #644
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
61389ca
Initial GCC container for Cpp, need to surpress request for port
robotdad 66304b0
Adding test
robotdad c77f1ca
Initial GCC container for Cpp, need to surpress request for port
robotdad 0ace195
Adding test
robotdad f4dcf7c
Merge branch 'master' of github.com:robotdad/vscode-docker
robotdad 0f1a1ae
Missed updated platform.ts
robotdad 08d5c52
Changing port to undefined so it doesn't prompt
robotdad 28d7130
Merge branch 'master' of https://github.com/Microsoft/vscode-docker
robotdad 02c6c10
Changed name to C++, fixed tests
robotdad 3250909
removing unused type
robotdad 9139d95
Removing another duplication...
robotdad a86ef3a
Fixing lint error
robotdad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these and instead use the ones from platform.ts (where they were moved to)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done. The PlatformOS type from platform.ts was already being used so that shouldn't have still been there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This applies to the extra Platform enum as well... Thx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh! Fixed.