Skip to content

Commit cca3643

Browse files
committed
initial impl.
1 parent 097e837 commit cca3643

37 files changed

+29669
-23
lines changed

.devcontainer/Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/typescript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
4+
ARG VARIANT="18-bullseye"
5+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
# && apt-get -y install --no-install-recommends <your-package-list-here>
10+
11+
# [Optional] Uncomment if you want to install an additional version of node using nvm
12+
# ARG EXTRA_NODE_VERSION=10
13+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
14+
15+
# [Optional] Uncomment if you want to install more global node packages
16+
# RUN su node -c "npm install -g <your-package-list -here>"

.devcontainer/devcontainer.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.234.0/containers/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
8+
// Append -bullseye or -buster to pin to an OS version.
9+
// Use -bullseye variants on local on arm64/Apple Silicon.
10+
"args": {
11+
"VARIANT": "16-bullseye"
12+
}
13+
},
14+
15+
// Set *default* container specific settings.json values on container create.
16+
"settings": {},
17+
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [
21+
"dbaeumer.vscode-eslint"
22+
],
23+
24+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
25+
// "forwardPorts": [],
26+
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
// "postCreateCommand": "yarn install",
29+
30+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
31+
"remoteUser": "node",
32+
"features": {
33+
"docker-from-docker": "latest"
34+
}
35+
}

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
client/node_modules
2+
client/dist

.github/workflows/docker-image.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Set up QEMU
15+
uses: docker/setup-qemu-action@v3
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
- name: Login to Docker Hub
19+
uses: docker/login-action@v3
20+
with:
21+
username: ${{ secrets.DOCKERHUB_USERNAME }}
22+
password: ${{ secrets.DOCKERHUB_TOKEN }}
23+
- name: Build and push
24+
uses: docker/build-push-action@v5
25+
with:
26+
context: .
27+
platforms: linux/amd64,linux/arm64
28+
push: true
29+
tags: daytonaio/daytona-docker-extension:0.22.1
30+
build-args: |
31+
"DAYTONA_SERVER_VERSION=v0.22.1"

.gitignore

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
auth/.pwd
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
16+
# IDEs and editors
17+
/.idea
18+
.project
19+
.classpath
20+
.c9/
21+
*.launch
22+
.settings/
23+
*.sublime-workspace
24+
25+
# IDE - VSCode
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
.history/*
32+
33+
# misc
34+
/.sass-cache
35+
/connect.lock
36+
/coverage
37+
/libpeerconnection.log
38+
npm-debug.log
39+
yarn-error.log
40+
testem.log
41+
/typings
42+
43+
# System Files
44+
.DS_Store
45+
Thumbs.db

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## v0.22.1
6+
7+
- Release update.
8+
9+
## v0.21.2
10+
11+
- Release update.
12+
- Set correct version of Daytona binary on download.
13+
14+
## v0.21.1
15+
16+
- Initial import.

CONTRIBUTING.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing to daytona Docker Extension
2+
3+
Hi, glad to know that you're interested in contributing. Here are
4+
some topics that can help you to get started:
5+
6+
- 💡 [Bugs and features](#bugs-and-features)
7+
- 🔧 [Environment setup](#environment-setup)
8+
9+
## Bugs and features
10+
11+
Whether it's a bug report or feature request, you're welcome to raise an
12+
**[issue](https://github.com/marcelo-ochoa/daytona-docker-extension/issues)** using the respective
13+
template.
14+
15+
We aim to respond to your issues and questions soonest. If you wish to receive a
16+
faster response, we recommend you always describe your steps and provide
17+
information about your environment in the bug reports. And if you're proposing a
18+
new feature, it'll help us to evaluate the priority if you explain why you need
19+
it.
20+
21+
## Environment setup
22+
23+
- Fork [this](https://github.com/marcelo-ochoa/daytona-docker-extension.git) repository.
24+
- Clone your forked copy of the project to a local environment.
25+
- Always merge commits from the upstream repository to your master branch to keep it updated.
26+
use
27+
28+
```bash
29+
git pull upstream master
30+
```
31+
32+
- Always create a new branch for changes, use
33+
34+
```bash
35+
git checkout -b <your_branch_name>
36+
```
37+
38+
- commit your changes
39+
- push your changes and raise a PR

Dockerfile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM --platform=$BUILDPLATFORM node:17.7-alpine3.14 AS client-builder
2+
WORKDIR /app/client
3+
4+
# cache packages in layer
5+
COPY client/package.json /app/client/package.json
6+
COPY client/package-lock.json /app/client/package-lock.json
7+
RUN --mount=type=cache,target=/usr/src/app/.npm \
8+
npm set cache /usr/src/app/.npm && \
9+
npm ci
10+
# install
11+
COPY client /app/client
12+
RUN npm run build
13+
14+
FROM golang:1.17-alpine AS builder
15+
ENV CGO_ENABLED=0
16+
WORKDIR /backend
17+
COPY vm/go.* .
18+
RUN --mount=type=cache,target=/go/pkg/mod \
19+
--mount=type=cache,target=/root/.cache/go-build \
20+
go mod download
21+
COPY vm/. .
22+
RUN --mount=type=cache,target=/go/pkg/mod \
23+
--mount=type=cache,target=/root/.cache/go-build \
24+
go build -trimpath -ldflags="-s -w" -o bin/service
25+
26+
FROM alpine:3.15
27+
ARG DAYTONA_SERVER_VERSION
28+
RUN apk update && apk add --no-cache curl openssh-client ncurses bash ttyd tini sudo bash-completion && \
29+
(curl -sf -L https://download.daytona.io/daytona/install.sh | bash) && \
30+
echo "daytona:x:1000:1000:Daytona:/home/daytona:/bin/bash" >> /etc/passwd && \
31+
echo "daytona:x:1000:" >> /etc/group
32+
33+
LABEL org.opencontainers.image.title="Daytona client tool"
34+
LABEL org.opencontainers.image.description="Docker Extension for using an embedded version of Daytona client/server tools."
35+
LABEL org.opencontainers.image.vendor="Marcelo Ochoa"
36+
LABEL com.docker.desktop.extension.api.version=">= 0.2.3"
37+
LABEL com.docker.extension.categories="database,utility-tools"
38+
LABEL com.docker.extension.screenshots="[{\"alt\":\"Sample usage using scott user\", \"url\":\"https://raw.githubusercontent.com/marcelo-ochoa/daytona-docker-extension/main/docs/images/screenshot2.png\"},\
39+
{\"alt\":\"Some formating options\", \"url\":\"https://raw.githubusercontent.com/marcelo-ochoa/daytona-docker-extension/main/docs/images/screenshot3.png\"},\
40+
{\"alt\":\"Explain Plan\", \"url\":\"https://raw.githubusercontent.com/marcelo-ochoa/daytona-docker-extension/main/docs/images/screenshot4.png\"}]"
41+
LABEL com.docker.extension.publisher-url="https://github.com/marcelo-ochoa/daytona-docker-extension"
42+
LABEL com.docker.extension.additional-urls="[{\"title\":\"Documentation\",\"url\":\"https://github.com/marcelo-ochoa/daytona-docker-extension/blob/main/README.md\"},\
43+
{\"title\":\"License\",\"url\":\"https://github.com/marcelo-ochoa/daytona-docker-extension/blob/main/LICENSE\"}]"
44+
LABEL com.docker.extension.detailed-description="Docker Extension for using Daytona client tool"
45+
LABEL com.docker.extension.changelog="See full <a href=\"https://github.com/marcelo-ochoa/daytona-docker-extension/blob/main/CHANGELOG.md\">change log</a>"
46+
LABEL com.docker.desktop.extension.icon="https://raw.githubusercontent.com/marcelo-ochoa/daytona-docker-extension/main/client/public/favicon.ico"
47+
LABEL com.docker.extension.detailed-description="Daytona is a self-hosted and secure open source development environment manager."
48+
COPY daytona.svg metadata.json docker-compose.yml /
49+
50+
COPY --from=client-builder /app/client/dist /ui
51+
COPY --from=builder /backend/bin/service /
52+
COPY --chown=1000:1000 startup.sh daytona.sh /sbin/
53+
54+
ENTRYPOINT ["/sbin/tini", "--", "/service", "-socket", "/run/guest-services/daytona-docker-extension.sock"]

0 commit comments

Comments
 (0)