Skip to content

Commit 39d6781

Browse files
authored
Creating a Dev Container File for the Project. (#10)
* Creating a Dev Container File for the Project. * Adding the Confluent CLI to the container environments.
1 parent 21f76c9 commit 39d6781

File tree

5 files changed

+73
-3
lines changed

5 files changed

+73
-3
lines changed

.devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/java:21",
3+
"customizations": {
4+
"vscode": {
5+
"extensions": [
6+
"redhat.java",
7+
"vscjava.vscode-java-pack",
8+
"confluentinc.vscode-confluent"
9+
]
10+
}
11+
},
12+
13+
"features": {
14+
"ghcr.io/devcontainers/features/java:1": {
15+
"version": "none",
16+
"installMaven": "true"
17+
}
18+
},
19+
20+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
21+
"workspaceFolder": "/workspace/exercises",
22+
23+
"remoteEnv": {
24+
"JAVA_HOME": "/usr/lib/jvm/msopenjdk-current"
25+
},
26+
27+
"mounts": [
28+
{
29+
"source": "${localWorkspaceFolder}/solutions",
30+
"target": "/workspace/exercises/solutions",
31+
"type": "bind"
32+
},
33+
{
34+
"source": "${localWorkspaceFolder}/README.md",
35+
"target": "/workspace/exercises/README.md",
36+
"type": "bind"
37+
}
38+
],
39+
40+
"onCreateCommand": "sudo curl -L --http1.1 https://cnfl.io/cli | sudo sh -s -- -b /usr/local/bin"
41+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
*.iml
2121
.idea
2222

23+
# VSCode
24+
.vscode
25+
2326
# Java
2427
target
2528

@@ -29,7 +32,6 @@ cloud.properties
2932
# Exercises folder
3033
exercises/*
3134
!exercises/exercise.sh
32-
!exercises/README.md
3335

3436
/flink*
3537

.gitpod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
image: gitpod/workspace-java-21
22

33
tasks:
4+
- init: sudo curl -L --http1.1 https://cnfl.io/cli | sudo sh -s -- -b /usr/local/bin
45
- command: gp open /workspace/learn-apache-flink-table-api-for-java-exercises/README.md && exit
56
- name: exercises
67
command: |

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@
1818

1919
## Version 0.3.2
2020

21-
* Added a basic Gitpod configuration file.
21+
* Added a basic Gitpod configuration file.
22+
23+
## Version 0.3.3
24+
25+
* Added a dev container file.
26+
* Updated the Gitpod configuration.

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,29 @@ The `solutions` folder contains complete solutions for each exercise. These will
5959

6060
In general, you can ignore this folder, but you might find it helpful to reference if you get stuck.
6161

62+
## Development Container
63+
64+
This repo contains a [.devcontainer.json](.devcontainer.json) file.
65+
66+
If you are using a Development Container compatible IDE (Eg. VS Code, IntelliJ Ultimate) and have Docker running, you can use the `.devcontainer.json` file to automatically configure your development environment with the required settings. This includes automatically setting up the correct version of the JVM, installing Maven, installing the Confluent CLI, and potentially configuring your IDE with any required plugins. It will give you a fully functional development environment in moments.
67+
Depending on what IDE you are using, the process can vary.
68+
69+
In VS Code, open the folder that contains the `.devcontainer.json` file. When prompted, re-open it in the container. Please note that you may need to install the Dev Containers plugin for VS Code prior to opening.
70+
71+
In IntelliJ Ultimate, right-click on the `.devcontainer.json` file, select the **Dev Containers** menu, and then choose **Create Dev Container and Mount Sources**. Once it has finished it will prompt you to connect to the container.
72+
73+
See here for more details:
74+
75+
- [Development Containers](https://containers.dev/)
76+
- [Development Containers in VS Code](https://code.visualstudio.com/docs/devcontainers/containers)
77+
- [Development Containers in IntelliJ](https://www.jetbrains.com/help/idea/connect-to-devcontainer.html)
78+
79+
If you are working in the Development Container and intend to use the Confluent CLI, you will need to login to the CLI using the [--no-browser](https://docs.confluent.io/confluent-cli/current/command-reference/confluent_login.html) flag.
80+
6281
## Gitpod
6382

6483
This repository contains a [Gitpod](https://www.gitpod.io/) configuration file. You can use Gitpod to spin up a browser-based development environment for working on these exercises.
6584

66-
[Open In Gitpod](https://gitpod.io/new/#https://github.com/confluentinc/learn-apache-flink-table-api-for-java-exercises)
85+
[Open In Gitpod](https://gitpod.io/new/#https://github.com/confluentinc/learn-apache-flink-table-api-for-java-exercises)
86+
87+
If you are working in Gitpod and intend to use the Confluent CLI, you will need to login to the CLI using the [--no-browser](https://docs.confluent.io/confluent-cli/current/command-reference/confluent_login.html) flag.

0 commit comments

Comments
 (0)