-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add devcontainers support #3475
Labels
Enhancement
New feature or request
Comments
Your FROM node:20.0-bullseye-slim
# install dependencies
RUN apt-get update && \
apt-get install -y \
build-essential \
git \
libgtk-3-dev \
libwebkit2gtk-4.0-dev \
nsis \
wget \
zsh \
&& rm -rf /var/lib/apt/lists/*
# setup zsh and oh-my-zsh
RUN git clone --single-branch --depth 1 https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
RUN cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
RUN chsh -s /bin/zsh
# install go 1.22.0
ARG GO_VERSION=1.22.0
RUN wget https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
&& rm go${GO_VERSION}.linux-amd64.tar.gz
# add go to path
ENV PATH=$PATH:/usr/local/go/bin
# set go path
ENV GOPATH=/usr/local/go
# install wails
RUN go install github.com/wailsapp/wails/v2/cmd/wails@latest
# make sure wails runs correctly
RUN wails doctor I got a dev container for wails at https://github.com/mateothegreat/wails-devcontainer. |
thanks, this worked! |
I'd love to know more about this. Is it vscode only? I'm wondering if it might be useful to "generate" a dev container. |
I only used with vscode. should be possible to |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
small developer QoL feature - add devcontainers recommended support.
Describe the solution you'd like
An easy way to get started using the vscode devcontainers setup.
This requires a setup with both golang and nodejs with reasonable versions.
I hoped to get a simple setup (file contents shown below). Due to version of node installed from 'apt-get install' I ended up with old Node 16 which causes this issue:
`myproject# wails dev
Wails CLI v2.8.2
Executing: go mod tidy
• Generating bindings: Done.
• Installing frontend dependencies: Done.
• Compiling frontend:
> frontend@0.0.0 build
> tsc && vite build
ERROR exit status 1`
I wasn't sure whether to raise this as a feature request or a bug.
Describe alternatives you've considered
Trying to make this Dockerfile to work: `FROM golang:1.22.3-bullseye
RUN apt-get update
Install necessary packages
RUN apt-get update && apt-get install -y curl git bash nodejs npm &&
rm -rf /var/lib/apt/lists/*
Setup environment variables for Go
ENV GOPATH=/go
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
RUN go install github.com/wailsapp/wails/v2/cmd/wails@latest
RUN apt -y install nsis
RUN apt -y install libgtk-3-dev libwebkit2gtk-4.0-dev
RUN wails doctor >doctor_out.txt
Setup working directory
WORKDIR /workspace
Port exposed for web server (adjust if different port is needed)
EXPOSE 3000
Keep container running (useful for dev containers)
CMD ["sleep", "infinity"]
`
Additional context
Devcontainer.json
{ "name": "Go and Node.js Dev Container", "build": { "dockerfile": "Dockerfile", "context": ".." }, "customizations": { "settings": { "terminal.integrated.shell.linux": "/bin/bash" }, "extensions": [ "golang.go", "dbaeumer.vscode-eslint" ] }, "forwardPorts": [ 3000 ], "postCreateCommand": "echo 'Container ready!'", "remoteUser": "root" }
The text was updated successfully, but these errors were encountered: