Need help with docker-code-server template.

Installed coder, configured template with architecture of host and docker_url. After successful build in workspaces started session, but there no button for vs code in browser.
No description
172 Replies
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
It was like for 30 minute and after that, its says unhealthy.
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i used docker-code-server template, installing on raspberry pi 3b+, set armv7 as host_arch.
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
my template looks like, i used linuxserver image of code-server because codercom was not found error appeared.
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
@Phorcys @Atif sorry for ping. Can you help me please? How can I get reason why it unhealthy? @colin (rust enthusiast) sorry for ping, I saw you helped a lot others.
Phorcys
Phorcys•2y ago
please just wait, we also have lifes of our own. I usually respond in less than a day
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Sorry for that.
Phorcys
Phorcys•2y ago
that's not the same issue does the terminal work?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
In site no It's always disconnected
Phorcys
Phorcys•2y ago
you should make your own dockerfile and install curl in it I think that's the issue
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Hmm that the main problem, I'm bad at docker anyway. Make dockerfile in the same path for template but in /images? And then add install curl? Or how. Is there some example and then should somehow import dockerfile in main.tf?
Phorcys
Phorcys•2y ago
it's not hard hold on
resource "docker_image" "image" {
name = "org/name:latest"

build {
path = "."
tag = ["org/name", "org/name:latest", "org/name:v0.1"]
}

keep_locally = true
}
resource "docker_image" "image" {
name = "org/name:latest"

build {
path = "."
tag = ["org/name", "org/name:latest", "org/name:v0.1"]
}

keep_locally = true
}
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
1 moment i will send you how my docker looks
FROM codercom/code-server

# Install prerequisites
RUN apt-get install -y \
curl
CMD /bin/bash
# 123
FROM codercom/code-server

# Install prerequisites
RUN apt-get install -y \
curl
CMD /bin/bash
# 123
Phorcys
Phorcys•2y ago
then in your docker_container resource you will set image = docker_image.basic_env.image_id won't work if codercom/code-server was not found it's because it doesn't support your architecture so it won't be found here either
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
oh, but linuxserver works
Phorcys
Phorcys•2y ago
FROM linuxserver/code-server:latest

RUN apt install -y curl
FROM linuxserver/code-server:latest

RUN apt install -y curl
do this instead
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i thought its support armv7(armhf)
Phorcys
Phorcys•2y ago
this is all you'd need
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i made in main.tf like this. my dockerfile called code-server. 1 moment i will fix path and etc
No description
Phorcys
Phorcys•2y ago
ni no path is good you just want Dockerfile in the same folder as the main.tf
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
but i put it in /images
Phorcys
Phorcys•2y ago
alright
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
like /template folder(where main.tf)/images
Phorcys
Phorcys•2y ago
then path is ./images yeh
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay i will push and try wo make workspace. Maybe minute 3-4 on push this error: A managed resource "docker_image" "basic_env" has not been declared in the root module.
Phorcys
Phorcys•2y ago
oh yeah replace basic_env with image my bad
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
no problem pushing This object has no argument, nested block, or exported attribute named "image_id".
Phorcys
Phorcys•2y ago
show me
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
sorry for screenshot putty not copying good in buffer
Phorcys
Phorcys•2y ago
do you have two docker_container resources?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
no
Phorcys
Phorcys•2y ago
idk it looks like so looks fine to me
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
1 got 1 docker_volume, 1 docker_image, and 1 docker_container no second docker_container, i really dont now why this error occur
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
full code of docker_container
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
terraform {
required_providers {
coder = {
source = "coder/coder"
version = "0.6.0"
}
docker = {
source = "kreuzwerker/docker"
version = "~> 2.20.2"
}
}
}

data "coder_provisioner" "me" {
}

provider "docker" {
}

data "coder_workspace" "me" {
}

resource "coder_agent" "main" {
arch = "armv7"
os = "linux"
startup_script = <<EOF
#!/bin/sh
# install and start code-server
# remove '-s -- --version 4.8.3' to install the latest version
curl -fsSL https://code-server.dev/install.sh | sh -s --
code-server --auth none --port 8080
EOF

# These environment variables allow you to make Git commits right away after creating a
# workspace. Note that they take precedence over configuration defined in ~/.gitconfig!
# You can remove this block if you'd prefer to configure Git manually or using
# dotfiles. (see docs/dotfiles.md)
env = {
GIT_AUTHOR_NAME = "${data.coder_workspace.me.owner}"
GIT_COMMITTER_NAME = "${data.coder_workspace.me.owner}"
GIT_AUTHOR_EMAIL = "${data.coder_workspace.me.owner_email}"
GIT_COMMITTER_EMAIL = "${data.coder_workspace.me.owner_email}"
}
}

resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
slug = "code-server"
display_name = "code-server"
url = "http://localhost:8080/?folder=/home/coder"
icon = "/icon/code.svg"
subdomain = false
share = "owner"

healthcheck {
url = "http://localhost:8080/healthz"
interval = 3
threshold = 10
}
}
terraform {
required_providers {
coder = {
source = "coder/coder"
version = "0.6.0"
}
docker = {
source = "kreuzwerker/docker"
version = "~> 2.20.2"
}
}
}

data "coder_provisioner" "me" {
}

provider "docker" {
}

data "coder_workspace" "me" {
}

resource "coder_agent" "main" {
arch = "armv7"
os = "linux"
startup_script = <<EOF
#!/bin/sh
# install and start code-server
# remove '-s -- --version 4.8.3' to install the latest version
curl -fsSL https://code-server.dev/install.sh | sh -s --
code-server --auth none --port 8080
EOF

# These environment variables allow you to make Git commits right away after creating a
# workspace. Note that they take precedence over configuration defined in ~/.gitconfig!
# You can remove this block if you'd prefer to configure Git manually or using
# dotfiles. (see docs/dotfiles.md)
env = {
GIT_AUTHOR_NAME = "${data.coder_workspace.me.owner}"
GIT_COMMITTER_NAME = "${data.coder_workspace.me.owner}"
GIT_AUTHOR_EMAIL = "${data.coder_workspace.me.owner_email}"
GIT_COMMITTER_EMAIL = "${data.coder_workspace.me.owner_email}"
}
}

resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
slug = "code-server"
display_name = "code-server"
url = "http://localhost:8080/?folder=/home/coder"
icon = "/icon/code.svg"
subdomain = false
share = "owner"

healthcheck {
url = "http://localhost:8080/healthz"
interval = 3
threshold = 10
}
}
resource "docker_volume" "home_volume" {
name = "coder-${data.coder_workspace.me.id}-home"
# Protect the volume from being deleted due to changes in attributes.
lifecycle {
ignore_changes = all
}
# Add labels in Docker to keep track of orphan resources.
labels {
label = "coder.owner"
value = data.coder_workspace.me.owner
}
labels {
label = "coder.owner_id"
value = data.coder_workspace.me.owner_id
}
labels {
label = "coder.workspace_id"
value = data.coder_workspace.me.id
}
# This field becomes outdated if the workspace is renamed but can
# be useful for debugging or cleaning out dangling volumes.
labels {
label = "coder.workspace_name_at_creation"
value = data.coder_workspace.me.name
}
}

resource "docker_image" "image" {
name = "org/code-server:latest"

build {
path = "./images"
tag = ["org/code-server", "org/code-server:latest", "org/code-server:v0.1"]
}

keep_locally = true
}
resource "docker_volume" "home_volume" {
name = "coder-${data.coder_workspace.me.id}-home"
# Protect the volume from being deleted due to changes in attributes.
lifecycle {
ignore_changes = all
}
# Add labels in Docker to keep track of orphan resources.
labels {
label = "coder.owner"
value = data.coder_workspace.me.owner
}
labels {
label = "coder.owner_id"
value = data.coder_workspace.me.owner_id
}
labels {
label = "coder.workspace_id"
value = data.coder_workspace.me.id
}
# This field becomes outdated if the workspace is renamed but can
# be useful for debugging or cleaning out dangling volumes.
labels {
label = "coder.workspace_name_at_creation"
value = data.coder_workspace.me.name
}
}

resource "docker_image" "image" {
name = "org/code-server:latest"

build {
path = "./images"
tag = ["org/code-server", "org/code-server:latest", "org/code-server:v0.1"]
}

keep_locally = true
}
resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = docker_image.image.image_id
# Uses lower() to avoid Docker restriction on container names.
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
# Hostname makes the shell more user friendly: coder@my-workspace:~$
hostname = data.coder_workspace.me.name
# Use the docker gateway if the access URL is 127.0.0.1
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
host {
host = "host.docker.internal"
ip = "host-gateway"
}
volumes {
container_path = "/home/coder/"
volume_name = docker_volume.home_volume.name
read_only = false
}
# Add labels in Docker to keep track of orphan resources.
labels {
label = "coder.owner"
value = data.coder_workspace.me.owner
}
labels {
label = "coder.owner_id"
value = data.coder_workspace.me.owner_id
}
labels {
label = "coder.workspace_id"
value = data.coder_workspace.me.id
}
labels {
label = "coder.workspace_name"
value = data.coder_workspace.me.name
}
}
resource "docker_container" "workspace" {
count = data.coder_workspace.me.start_count
image = docker_image.image.image_id
# Uses lower() to avoid Docker restriction on container names.
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
# Hostname makes the shell more user friendly: coder@my-workspace:~$
hostname = data.coder_workspace.me.name
# Use the docker gateway if the access URL is 127.0.0.1
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
host {
host = "host.docker.internal"
ip = "host-gateway"
}
volumes {
container_path = "/home/coder/"
volume_name = docker_volume.home_volume.name
read_only = false
}
# Add labels in Docker to keep track of orphan resources.
labels {
label = "coder.owner"
value = data.coder_workspace.me.owner
}
labels {
label = "coder.owner_id"
value = data.coder_workspace.me.owner_id
}
labels {
label = "coder.workspace_id"
value = data.coder_workspace.me.id
}
labels {
label = "coder.workspace_name"
value = data.coder_workspace.me.name
}
}
@Phorcys full code of main.tf with your fixes.
Phorcys
Phorcys•2y ago
try setting kreuzwerker/docker version to 2.23.1 I think image_id is new
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
without ~>? seems like it started pushing
Phorcys
Phorcys•2y ago
with
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
oh
Phorcys
Phorcys•2y ago
it's whatever
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
its pushed but i will repush with ~>, and try to make workspace Error: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1976360995/Dockerfile: no such file or directory i get this error and its failed for all build
Terraform 1.3.4
coder_agent.main: Plan to replace
docker_image.image: Plan to create
coder_app.code-server: Plan to replace
docker_container.workspace[0]: Plan to create
docker_image.image: Creating...
coder_app.code-server: Destroying... [id=e78a8447-1689-4678-b775-a5a51b44f085]
coder_app.code-server: Destruction complete after 0s
coder_agent.main: Destroying... [id=d4044fe8-f50c-4771-a81d-d39c7a09ef2d]
coder_agent.main: Destruction complete after 0s
coder_agent.main: Creating...
coder_agent.main: Creation complete after 0s [id=f6574005-dffc-43a6-a7e0-31c885feb488]
coder_app.code-server: Creating...
coder_app.code-server: Creation complete after 0s [id=1c86dbf6-cb4f-4f40-9239-b5533ffb4fff]
docker_image.image: Creation errored after 4s
Error: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1976360995/Dockerfile: no such file or directory
Terraform 1.3.4
coder_agent.main: Plan to replace
docker_image.image: Plan to create
coder_app.code-server: Plan to replace
docker_container.workspace[0]: Plan to create
docker_image.image: Creating...
coder_app.code-server: Destroying... [id=e78a8447-1689-4678-b775-a5a51b44f085]
coder_app.code-server: Destruction complete after 0s
coder_agent.main: Destroying... [id=d4044fe8-f50c-4771-a81d-d39c7a09ef2d]
coder_agent.main: Destruction complete after 0s
coder_agent.main: Creating...
coder_agent.main: Creation complete after 0s [id=f6574005-dffc-43a6-a7e0-31c885feb488]
coder_app.code-server: Creating...
coder_app.code-server: Creation complete after 0s [id=1c86dbf6-cb4f-4f40-9239-b5533ffb4fff]
docker_image.image: Creation errored after 4s
Error: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1976360995/Dockerfile: no such file or directory
Phorcys
Phorcys•2y ago
try moving the dockerfile to same folder as template and use path . maybe that's the issue idk
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
ok 1 moment
Phorcys
Phorcys•2y ago
should be fine but we never know
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
if docker file named code-server, that code correct? build { path = "." tag = ["org/code-server", "org/code-server:latest", "org/code-server:v0.1"] } still same error Error: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3808798986/Dockerfile: no such file or directory. extension name for dockerfile must be .Dockerfile?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
did it correct ended?
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
@Phorcysi tried to change names and values in image resource, still no work. Maybe there chance to install curl in startup script? Or prefer using dockerfile?
Phorcys
Phorcys•2y ago
the name must be "Dockerfile" if you don't specify a name argument
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
dockerfile named code-server.Dockerfile correct? and there code-server like named file
Phorcys
Phorcys•2y ago
no
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
is it correct?
Phorcys
Phorcys•2y ago
no
build {
path = "."
dockerfile = "code-server.Dockerfile"
tag = ["org/code-server", "org/code-server:latest", "org/code-server:v0.1"]
}
build {
path = "."
dockerfile = "code-server.Dockerfile"
tag = ["org/code-server", "org/code-server:latest", "org/code-server:v0.1"]
}
tag doesn't have to do with filename
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
correct?
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay, pushing
Phorcys
Phorcys•2y ago
depends on the name of your file and it's location
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
in same folder as main.tf and name how i wrote it. pushing, and makign workspace. Will see if it works Still same error
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.3.4
docker_image.image: Plan to create
coder_agent.main: Plan to replace
coder_app.code-server: Plan to replace
docker_container.workspace[0]: Plan to create
coder_app.code-server: Destroying... [id=1c86dbf6-cb4f-4f40-9239-b5533ffb4fff]
coder_app.code-server: Destruction complete after 0s
coder_agent.main: Destroying... [id=f6574005-dffc-43a6-a7e0-31c885feb488]
coder_agent.main: Destruction complete after 0s
docker_image.image: Creating...
coder_agent.main: Creating...
coder_agent.main: Creation complete after 0s [id=5b693002-aa55-4907-8d92-3700afe82471]
coder_app.code-server: Creating...
coder_app.code-server: Creation complete after 0s [id=5bb77bad-bf7c-4469-88e1-d038426ca02d]
docker_image.image: Creation errored after 1s
Error: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount4153437782/code-server.Dockerfile: no such file or directory
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform 1.3.4
docker_image.image: Plan to create
coder_agent.main: Plan to replace
coder_app.code-server: Plan to replace
docker_container.workspace[0]: Plan to create
coder_app.code-server: Destroying... [id=1c86dbf6-cb4f-4f40-9239-b5533ffb4fff]
coder_app.code-server: Destruction complete after 0s
coder_agent.main: Destroying... [id=f6574005-dffc-43a6-a7e0-31c885feb488]
coder_agent.main: Destruction complete after 0s
docker_image.image: Creating...
coder_agent.main: Creating...
coder_agent.main: Creation complete after 0s [id=5b693002-aa55-4907-8d92-3700afe82471]
coder_app.code-server: Creating...
coder_app.code-server: Creation complete after 0s [id=5bb77bad-bf7c-4469-88e1-d038426ca02d]
docker_image.image: Creation errored after 1s
Error: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount4153437782/code-server.Dockerfile: no such file or directory
but now it sees code-server.Dockerfile. But what is the problem
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
there just no anything about image
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
isnt it not correct? @Phorcys
Phorcys
Phorcys•2y ago
that is good
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
then i dont have any idea why its cant find dockerfile its in site already
Phorcys
Phorcys•2y ago
can you show me your template folder's tree?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
ls?
Phorcys
Phorcys•2y ago
tree
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
in terminal no command tree wait coder template tree? there no command
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
in site it like this
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
mmisunderstood you, sorry 1 moment fixed naming error there was double -- in name
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
waiting for code-server initialization
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
@Phorcys still unhealthy, after success build
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
and terminal dont work too
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Gotta go, thanks for your help. Will try tomorrow, if you got any idea why its not works write please. Or what i should do to give you more information
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i sshed to workspace and enter curl and it worked but code-server not found maybe this is the problem? But why then terminal dont works
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
@Phorcys I found problem, not installed node.js with npm. Because it's armv7 and there not standalone release it's tries to install using npm but there no npm and node.js, isn't in image supposed to be installed code-server? That linuxserver/code-server And maybe if you know. I tried install code-server on pi without coder(for first time) and in script output installation was okay but when I started code it's says that vscode-oniguruna, vscode-textmate and xterm was not found. And like terminal not worked and detail in extension pages not works too. So I don't know how to fix it too. Because not so much people have that problem. That's why I thought installing coder and then using docker and coder it will works good. But now I got more problems:) Will wait for your response soon
Phorcys
Phorcys•2y ago
I will take a look once I'm at my office
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
If you need something like logs, ping me
Phorcys
Phorcys•2y ago
yeah that was definitely the issue yeah so unhealthy only means that vscode didn't load it should but that is weird I'm going to help in a bit trying to think how to solve this
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
But in startup_script I wrote install code-server and etc
Phorcys
Phorcys•2y ago
you should install code-server from the image itself not the startup script does your pi run arm64 ?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
In template main.tf for docker there was just start code-server but it didn't Wark too It's 3b+ which mean armv7l processor installed
Phorcys
Phorcys•2y ago
alright so
FROM ubuntu:latest

RUN apt install -y curl wget
RUN curl -fsSL https://code-server.dev/install.sh | sh -s --
FROM ubuntu:latest

RUN apt install -y curl wget
RUN curl -fsSL https://code-server.dev/install.sh | sh -s --
here's what I'd do
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Okay 1 moment
Phorcys
Phorcys•2y ago
and remove the code-server install from your startup_script
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Okay Just leave start code-server like "code-server and arguments"
Phorcys
Phorcys•2y ago
yes hold on the dockerfile is wrong
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Your or mine?
Phorcys
Phorcys•2y ago
both lol hold on
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Okay, but why you use latest when in build logs it's saying like it deprecated
Phorcys
Phorcys•2y ago
you're right, just old bad habits
FROM ubuntu:20.04

# Set DEBIAN_FRONTEND for headless installation
ENV DEBIAN_FRONTEND=noninteractive

# Install packages
RUN apt update -y
RUN apt install -y curl wget

# Install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh -s --

# Revert DEBIAN_FRONTEND to default
ENV DEBIAN_FRONTEND=dialog

# Create non-root "coder" user
RUN useradd coder --create-home --shell=/bin/bash --uid=1000 --user-group && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd && \
echo "permit nopass coder as root" >> /etc/doas.conf

# Switch to "coder" user
USER 1000
ENV USER=coder
WORKDIR /home/coder
FROM ubuntu:20.04

# Set DEBIAN_FRONTEND for headless installation
ENV DEBIAN_FRONTEND=noninteractive

# Install packages
RUN apt update -y
RUN apt install -y curl wget

# Install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh -s --

# Revert DEBIAN_FRONTEND to default
ENV DEBIAN_FRONTEND=dialog

# Create non-root "coder" user
RUN useradd coder --create-home --shell=/bin/bash --uid=1000 --user-group && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd && \
echo "permit nopass coder as root" >> /etc/doas.conf

# Switch to "coder" user
USER 1000
ENV USER=coder
WORKDIR /home/coder
this should work
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay, and in main.tf delete install code-server code. Just run it
Phorcys
Phorcys•2y ago
yes
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
startup_script "code-server --auth none --port 8080" like in template
Phorcys
Phorcys•2y ago
yes
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Okay creating workspace Error: executor failed running [/bin/sh -c apt update -y]: exit code: 100 oh wait i made mistake when copied docker wait no mistake all correct yeah its correct and in main its seems correct
Phorcys
Phorcys•2y ago
try this
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
pushing still same error with apt update -y
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
No description
Phorcys
Phorcys•2y ago
how it should definitely just work
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i dont know
Phorcys
Phorcys•2y ago
lol can you upload this dockerfile to your server and try running docker build with it ? so we can see the actual error
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
It's on my server 1 moment I will build it Isn't error can be because Part where user creating it's in 1 line Not in lines like you
Phorcys
Phorcys•2y ago
wdym
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Part where you create User in dockerfile I copied and pasted in 1 whole line
Phorcys
Phorcys•2y ago
show me
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
like this
No description
No description
Phorcys
Phorcys•2y ago
that can't work add a line break after every \
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay, i actually dont understand why command docker build -f code-server.Dockerfile not work. On my machine it says like requires 1 argument and i in directory with dockerfile
Phorcys
Phorcys•2y ago
can you show me the error ?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
1 moment, editing Dockerfile how you said
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
like this?
No description
Phorcys
Phorcys•2y ago
should work
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Dockerfile in this folder
Phorcys
Phorcys•2y ago
try docker build -f code-server.Dockerfile .
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
building
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
error. Log:
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
any ideas
Phorcys
Phorcys•2y ago
sorry so
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i tried adding missing key but its saying that no package gnupg, gnupg1 or gnupg2 and i cant install them with apt get because of there no this packages in repo
Phorcys
Phorcys•2y ago
I have searched a bit try to update your host system (raspberry pi)'s docker / runc / libseccomp
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
this 3 packages?
Phorcys
Phorcys•2y ago
yeh
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
and docker latest version on my pi
Phorcys
Phorcys•2y ago
alright try dockerd too if that doesn't work then changing the ubuntu version should work
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
what it
Phorcys
Phorcys•2y ago
since i've just read it's a jammy issue docker daemon just run apt full-upgrade basically
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
in dockerfile ?
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
sed
No description
Phorcys
Phorcys•2y ago
not in the container inside your host
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
oh lol sorry
Phorcys
Phorcys•2y ago
it's fine
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay not too much on update 130 mb need wait for some time isnt it a problem that i use debian?
Phorcys
Phorcys•2y ago
shouldn't be if it's still not working then use this
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
its not updated anything that related with docker, only nodejs and some packages for 3dprinter
Phorcys
Phorcys•2y ago
yeah then that
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
oh wait
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
changed to ubunto 20.04
No description
Phorcys
Phorcys•2y ago
wtf honestly idk and i've got some stuff to do maybe you can try changing your source image to debian ? this is so weird
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay, when you will be free, ping me oka i will try play with images
Phorcys
Phorcys•2y ago
debian:bullseye should be a nice fit
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
or debian:11 , in docker hub said it works too same error I think I will make something with host because it's host problem
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
So i managed install libseccomp2-2.5.1.1 which fixes error. Strange why full update doesnt want to update that too. Now need to install npm and node.js or use image where its already installed for armv7l
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
now i managed in docker container all but on installing code-server error from gyp
No description
Phorcys
Phorcys•2y ago
i think it's because you're using an arm machine doesn't seem like an error though
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
yeah i found thread in code-server related to argon2 and pi. But i dont know to implement fix in docker.
Phorcys
Phorcys•2y ago
show me
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Its stopping creating docker then
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
GitHub
[Bug]: argon2 can't rebuild at alpine 3.15 node 16 · Issue #5184 · ...
Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: Local OS: Windows Remote OS: Alpine Remote Architecture: amd64 code-server --version: 4.4.0 ...
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
there posts about pi in it
Phorcys
Phorcys•2y ago
i will look later
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
okay
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
seems i added something that finished instal of code-server. Waiting for full build
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
i just dont know if it normal if it stay and dont do nothing after this oh, nvm started other thing its said that i finished wit hsucces
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
seems like working container. Will push it
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
is there any chance to output logs on build state in coder. For website. Like to see on what state of building docker
Phorcys
Phorcys•2y ago
I don't think so
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Sed, because i added so much installing for node-gyp and now its building like 10 mins min
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
like this
No description
Phorcys
Phorcys•2y ago
maybe in some temp directory
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
do you know at what temp?
Phorcys
Phorcys•2y ago
i really don't
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
seems good, waiting
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
@Phorcys opened vscode link
No description
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
and terminal not works too in logs nothing for code-server normal startup with 127.0.0.1:8080 address , tried with same address but port 5050 nothing its says error 500 in console any ideas? First of all, only now i remember that where i setting coder is just rpi 3, not 3b+ . And i was thinking about installing on second board which 3b+. Now i see that in codercom images arm64(which support rpi3b+). So i will install it on correct board. And if error still there i will read another problem.(stupid head)
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
@PhorcysThank you for your support for this 2 days. As i wrote above in last messages i did some mistakes. Maybe someday i will manage to run it on 3b(if it neede) but now it works on 3b+.
No description
Phorcys
Phorcys•2y ago
cool ! thanks for letting me know
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
Sorry if disturb you
Phorcys
Phorcys•2y ago
nah you're not i was just kinda busy today
BoJIwEbNuK
BoJIwEbNuKOP•2y ago
And anyway thank you. Now i will start play with Dockerfiles and etc to make it more beatiful for me
Want results from more Discord servers?
Add your server