-
Notifications
You must be signed in to change notification settings - Fork 20
devcontainer added #163
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
devcontainer added #163
Changes from all commits
f6da4a1
e96394f
fffdd77
8fdd3b2
7d01d74
6b60c7c
7ccb58f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // For format details, see https://containers.dev/implementors/json_reference/ | ||
| { | ||
| "name": "Java Developer Container", | ||
| "build": { | ||
| "dockerfile": "../Dockerfile", | ||
| "target": "developer" | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| // Set *default* container specific settings.json values on container create. | ||
| "settings": {}, | ||
| // Add the IDs of extensions you want installed when the container is created. | ||
| "extensions": [ | ||
| "ms-python.python", | ||
| "vscjava.vscode-java-pack", | ||
| "vmware.vscode-boot-dev-pack", | ||
| "github.vscode-github-actions", | ||
| "redhat.vscode-yaml", | ||
| "ms-azuretools.vscode-docker" | ||
| ] | ||
| } | ||
| }, | ||
| "features": { | ||
| // Some default things like git config | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "upgradePackages": false | ||
| } | ||
| }, | ||
| "runArgs": [ | ||
| // Allow the container to access the host X11 display and EPICS CA | ||
| "--net=host", | ||
| // Make sure SELinux does not disable with access to host filesystems like tmp | ||
| "--security-opt=label=disable", | ||
| // Mount the user sockets folder | ||
| "-v${localEnv:XDG_RUNTIME_DIR}:${localEnv:XDG_RUNTIME_DIR}", | ||
| // add the docker socket environment variable to the container | ||
| "-e=DOCKER_HOST=${localEnv:DOCKER_HOST}" | ||
| ], | ||
| // Mount the parent as /workspaces so we can pip install peers as editable | ||
| "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind", | ||
| // for rootless we must not to mess with user ids inside the container | ||
| "updateRemoteUserUID": false, | ||
| // for rootless we are root inside the container | ||
| "remoteUser": "root" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,41 @@ | ||
| FROM eclipse-temurin:17-jre | ||
| # Stage 1: Development stage | ||
| FROM eclipse-temurin:17-jdk AS developer | ||
|
|
||
| # deployment unit | ||
| COPY target/ChannelFinder-*.jar /channelfinder/ChannelFinder-*.jar | ||
| ENV DOCKER=docker-27.3.1 | ||
|
|
||
| # Install Maven and Git for development purposes | ||
| RUN apt-get update && \ | ||
| apt-get install -y maven git && \ | ||
| apt-get clean | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will want docker as well for running the testcontainers based integration tests.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, I haven't worked with testcontainers before. I think the docker-in-docker would use the host docker through a socket. Or rather 'podman in podman' for the DLS users.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really want to approve without knowing the following command passes in a devcontainer:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will test this
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in which instance would you like to run this? I could drop it here instead of line 23 in Dockerfile RUN mvn clean install
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok so theoretically the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I installed podman but it refuses to run as root maybe I need to add something about a new user into devcontainer or Dockerfile
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried parametrizing the remoteUser (comment it out), but it's still as root
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even podman pull docker.elastic.co/elasticsearch/elasticsearch:8.16.1
Trying to pull docker.elastic.co/elasticsearch/elasticsearch:8.16.1...
Getting image source signatures
Copying blob 4ca545ee6d5d done |
Copying blob e7894aa63b6b done |
Copying blob fc92672f5fb7 done |
Copying blob deb9b088b6a9 done |
Copying blob d06b22f717ef done |
Copying blob 9ab872b2449e done |
Copying blob 533fb8518242 done |
Copying blob 17672f99d9ac done |
Copying blob 7936da0b8295 done |
Copying blob f4101ba1f689 done |
Error: copying system image from manifest list: writing blob: adding layer with blob "sha256:e7894aa63b6b441f711d543f0bd9f3584e66c7aac167b2f7ceac4bab2a89ca48": processing tar file(potentially insufficient UIDs or GIDs available in user namespace (requested 0:42 for /etc/gshadow): Check /etc/subuid and /etc/subgid if configured locally and run "podman system migrate": lchown /etc/gshadow: invalid argument): exit status 1 |
||
|
|
||
|
|
||
| # install the docker ce cli binary | ||
| RUN curl -O https://download.docker.com/linux/static/stable/x86_64/${DOCKER}.tgz && \ | ||
| tar xvf ${DOCKER}.tgz && \ | ||
| cp docker/docker /usr/bin && \ | ||
| rm -r ${DOCKER}.tgz docker | ||
|
|
||
| # Set the working directory for development | ||
| WORKDIR /workspace | ||
|
|
||
| # Optionally, start an interactive shell for development | ||
| CMD ["/bin/bash"] | ||
|
|
||
| # Stage 2: Build stage | ||
| FROM developer as builder | ||
|
|
||
| # Copy the application code from the developer workspace or local context | ||
| COPY . /workspace | ||
| WORKDIR /workspace | ||
|
|
||
| # Run Maven to clean and build the application JAR | ||
| RUN mvn clean install | ||
|
|
||
| # Stage 3: Production deployment stage | ||
| FROM eclipse-temurin:17-jre AS production | ||
|
|
||
| # Copy only the built JAR from the builder stage | ||
| COPY --from=builder /workspace/target/ChannelFinder-*.jar /channelfinder/ChannelFinder-*.jar | ||
|
|
||
| # Set the CMD to run the application in production mode | ||
| CMD ["java", "-jar", "/channelfinder/ChannelFinder-*.jar", "--spring.config.name=application"] | ||
Uh oh!
There was an error while loading. Please reload this page.