I'm trying to follow this: https://github.com/ecarlson94/vscode-flutter-dev-container
but hitting a build error and not able to proceed.
[+] Building 68.4s (9/10)
=> [internal] load build definition from Dockerfile-with-features 0.0s
=> => transferring dockerfile: 4.07kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 0.0s
=> [dev_container_auto_added_stage_label 1/7] FROM docker.io/library/ubu 0.0s
=> CACHED [dev_container_auto_added_stage_label 2/7] RUN apt update && 0.0s
=> CACHED [dev_container_auto_added_stage_label 3/7] RUN APT-GET autorem 0.0s
=> CACHED [dev_container_auto_added_stage_label 4/7] RUN GROUPADD --gid 0.0s
=> CACHED [dev_container_auto_added_stage_label 5/7] RUN curl -C - --out 0.0s
=> ERROR [dev_container_auto_added_stage_label 6/7] RUN sdkmanager "sy 68.3s
------
> [dev_container_auto_added_stage_label 6/7] RUN sdkmanager "system-images;and
roid-33;google_apis;x86_64" && avdmanager create avd -n Android33 -k "syste
m-images;android-33;google_apis;x86_64":
#9 1.994 Loading package information...
[=======================================] 100% Unzipping... x86_64/data/misc/mod
#9 67.90 Loading local repository...
Auto-selecting single ABI x86_64========] 100% Fetch remote repository...
#9 68.21 Do you wish to create a custom hardware profile? [no] offset 0, count -
1, length 256
------
error: failed to solve: executor failed running [/bin/sh -c sdkmanager "system-i
mages;android-${ANDROID_PLATFORM_VERSION};google_apis;x86_64" && avdmanager c
reate avd -n Android${ANDROID_PLATFORM_VERSION} -k "system-images;android-${ANDR
OID_PLATFORM_VERSION};google_apis;x86_64"]: exit code: 1
[74609 ms] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\Users\Ian\AppData\Local\Temp\devcontainercli\container-features\0.29.0-1675605529067\Dockerfile-with-features -t vsc-flutter-dev-container-421d5355087fab30e642f834c99e5e5b --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer
[74609 ms] at pie (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1916:1698)
[74610 ms] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[74610 ms] at async vF (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1915:1972)
[74610 ms] at async P7 (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1915:901)
[74610 ms] at async Fie (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1921:2093)
[74610 ms] at async Vf (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:1921:3241)
[74610 ms] at async eoe (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:2045:17324)
[74610 ms] at async Qse (c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js:2045:17065)
[74620 ms] Exit code 1
[74624 ms] Command failed: C:\Users\Ian\AppData\Local\Programs\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\Ian\.vscode\extensions\ms-vscode-remote.remote-containers-0.275.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\Ian\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder tmp/devcontainers-db9859e4-fbb5-4b56-a2af-cc2ff00bf4911675605524034 --workspace-folder d:\Work\FlutterDev\projects\flutter-dev-container --workspace-mount-consistency cached --id-label devcontainer.local_folder=d:\Work\FlutterDev\projects\flutter-dev-container --id-label devcontainer.config_file=d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer\devcontainer.json --log-level debug --log-format json --config d:\Work\FlutterDev\projects\flutter-dev-container\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[74624 ms] Exit code 1
Anyone have any advice please?
TIA
Cloned repo, reopened folder in containe in VS code, build
Related
I have a problem while building docker. Error is following:
=> => transferring dockerfile: 327B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name "postgres:": invalid reference format
ERROR: Service 'postgres' failed to build : Build failed
I tried to find what was the problem, but still stuck with this, so I kindly ask for your help. This is the Docker file:
FROM postgres:${POSTGRES_VERSION}
ARG TZ=UTC
ENV TZ ${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R postgres:root /var/lib/postgresql
#COPY my.cnf /etc/postgresql/conf.d/my.cnf
CMD ["postgres"]
EXPOSE 5432
Not sure what can be the problem here, but I'm getting an error mentioned previously. Thank you in advance for your help.
UPDATE:
It was an error due to problems with reading version of postgres, as #Makariy mentioned in comment.
Maybe you should add variable POSTGRES_VERSION
ARG POSTGRES_VERSION
FROM postgres:${POSTGRES_VERSION}
...
And then build image docker build --build-arg POSTGRES_VERSION=9.6 . for example
Also this docs could be helpful
[vscode remote container failed] because Failed to download VS Code Server and HTTP 407 - Proxy Authentication Required
logs as below
[4 ms] Remote-Containers 0.163.0 in VS Code 1.54.1 (f30a9b73e8ffc278e71575118b6bf568f04587c8).
[81 ms] Start: Resolving Remote
[84 ms] Setting up container: /beautiful_leakey
[88 ms] Start: Run: docker inspect --type container /beautiful_leakey
[152 ms] Start: Check Docker is running
[152 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[222 ms] Server API version: 1.40
[223 ms] Start: Inspecting container
[223 ms] Start: Run: docker inspect --type container 7ae9aff5ec5921df298a7e47504241bc93f4906d37849b9aa915da8c47a4c12d
[292 ms] Start: Run: docker exec -i -u root -e VSCODE_REMOTE_CONTAINERS_SESSION=541b98c3-3bff-463f-9e0f-ea4e6a5e4ee01614950083609 7ae9aff5ec5921df298a7e47504241bc93f4906d37849b9aa915da8c47a4c12d /bin/sh
[297 ms] Start: Run in container: uname -m
[414 ms] x86_64
[414 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[416 ms] PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[416 ms] Start: Run in container: cat /etc/passwd
[419 ms] Start: Run in container: test -d /root/.vscode-server
[421 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[423 ms] Exit code 2
[423 ms] Start: Run in container: cat /root/.vscode-server/data/Machine/settings.json
[425 ms] cat: /root/.vscode-server/data/Machine/settings.json: No such file or directory
[425 ms] Exit code 1
[425 ms] Start: Run in container: test -d /root/.vscode-server/bin/f30a9b73e8ffc278e71575118b6bf568f04587c8
[426 ms] Exit code 1
[426 ms] Start: Run in container: test -d /vscode/vscode-server/bin/x64/f30a9b73e8ffc278e71575118b6bf568f04587c8
[427 ms] Exit code 1
[428 ms] Installing VS Code Server for commit f30a9b73e8ffc278e71575118b6bf568f04587c8
[428 ms] Start: Downloading VS Code Server
[494 ms] Failed to download VS Code Server (https://update.code.visualstudio.com/commit:f30a9b73e8ffc278e71575118b6bf568f04587c8/server-linux-x64/stable): HTTP 407 - Proxy Authentication Required
can anybody help me?
I want to build docker images and push into ECR for that I have written below buildspect.yml file and build my project using AWS build project service.
My buildspec.yml file is as below:
version: 0.2
phases:
install:
runtime-versions:
docker: 18
commands:
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://localhost:2375 --storage-driver=overlay2&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
pre_build:
commands:
- $(aws ecr get-login --no-include-email --region ${AWS_DEFAULT_REGION})
- REPOSITORY_URI_SERVER=<accountnumber>.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${IMAGE_NAME}
build:
commands:
- docker-compose build
post_build:
commands:
- docker-compose push
While I do build using AWS build project service then I will get an error like:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
[Container] 2020/07/10 01:57:15 Command did not exit successfully timeout 15 sh -c "until docker info; do echo .; sleep 1; done" exit status 124
[Container] 2020/07/10 01:57:15 Phase complete: INSTALL State: FAILED
[Container] 2020/07/10 01:57:15 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: timeout 15 sh -c "until docker info; do echo .; sleep 1; done". Reason: exit status 124
I have tried to write buildspect.yml file as below
I have added an artifact tag in my file that is the place where my project build is a store.
post_build:
commands:
- docker-compose push
- printf '[{"name":"<name of container>","imageUri":"<path of your image"}]' > imagedefinitions.json
- cat imagedefinitions.json
artifacts:
files: imagedefinitions.json
I got success in it.
Does anyone have a working azure-pipelines.yaml file that utilizes containers only to build Dockerfiles which I have in my repo.
resources:
containers:
- container: docker-image
image: docker:18.09.6
jobs:
- job: Build
container: docker-image
steps:
- script: |
echo hello from Linux
Docker --version
The above ends up with the error:
##[section]Starting: Initialize containers
##[command]/usr/bin/docker version --format '{{.Server.APIVersion}}'
'1.40'
Docker daemon API version: '1.40'
##[command]/usr/bin/docker version --format '{{.Client.APIVersion}}'
'1.40'
Docker client API version: '1.40'
##[command]/usr/bin/docker ps --all --quiet --no-trunc --filter "label=f38b39"
##[command]/usr/bin/docker network prune --force --filter "label=f38b39"
##[command]/usr/bin/docker network create --label f38b39 vsts_network_b78f6272ef304388ac849f3f37071eea
fda578a22eeb5aae1fcd41a4b816a279d20cfa552dbe3ad366fa2a009ab35313
##[command]/usr/bin/docker pull docker:18.09.6
18.09.6: Pulling from library/docker
e7c96db7181b: Already exists
5297bd381816: Pulling fs layer
3a664477889c: Pulling fs layer
a9b893dcc701: Pulling fs layer
48bf7c1cb0dd: Pulling fs layer
555b6ea27ad2: Pulling fs layer
48bf7c1cb0dd: Waiting
555b6ea27ad2: Waiting
3a664477889c: Verifying Checksum
3a664477889c: Download complete
5297bd381816: Download complete
48bf7c1cb0dd: Verifying Checksum
48bf7c1cb0dd: Download complete
5297bd381816: Pull complete
555b6ea27ad2: Verifying Checksum
555b6ea27ad2: Download complete
a9b893dcc701: Verifying Checksum
a9b893dcc701: Download complete
3a664477889c: Pull complete
a9b893dcc701: Pull complete
48bf7c1cb0dd: Pull complete
555b6ea27ad2: Pull complete
Digest: sha256:bf929409251faa1d1fcf63af68d02bb942054cfbe14e6ad9dca0dc4a01cbffad
Status: Downloaded newer image for docker:18.09.6
docker.io/library/docker:18.09.6
##[command]/usr/bin/docker inspect --format="{{index .Config.Labels \"com.azure.dev.pipelines.agent.handler.node.path\"}}" docker:18.09.6
##[command]/usr/bin/docker create --name docker-image_docker18096_794554 --label f38b39 --network vsts_network_b78f6272ef304388ac849f3f37071eea -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/vsts/work/1":"/__w/1" -v "/home/vsts/work/_temp":"/__w/_temp" -v "/opt/hostedtoolcache":"/__t" -v "/home/vsts/work/_tasks":"/__w/_tasks" -v "/home/vsts/agents/2.150.3/externals":"/__a/externals":ro -v "/home/vsts/work/.taskkey":"/__w/.taskkey" docker:18.09.6 "/__a/externals/node/bin/node" -e "setInterval(function(){}, 24 * 60 * 60 * 1000);"
b8856a42131206302453903ae8fbc85957368b2e377ee5a9d1b44627130006b0
##[command]/usr/bin/docker start b8856a42131206302453903ae8fbc85957368b2e377ee5a9d1b44627130006b0
b8856a42131206302453903ae8fbc85957368b2e377ee5a9d1b44627130006b0
##[command]/usr/bin/docker ps --all --filter id=b8856a42131206302453903ae8fbc85957368b2e377ee5a9d1b44627130006b0 --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
b8856a42131206302453903ae8fbc85957368b2e377ee5a9d1b44627130006b0 Up Less than a second
##[command]/usr/bin/docker exec b8856a42131206302453903ae8fbc85957368b2e377ee5a9d1b44627130006b0 sh -c "command -v bash"
OCI runtime exec failed: exec failed: cannot exec a container that has stopped: unknown
##[error]Docker exec fail with exit code 126
##[section]Finishing: Initialize containers
that's because that container doesnt run endlessly if you just start it, it exits, change docker:18.09.6 to ubuntu or something that doesnt exit immediately and it will work.
I've set up all of things for deploy ruby on rails by capistrano on ubuntu server 14.10
but when i execute command by cap production setup or deploy
i've got this error message so i found out path by .rbenv/bin/rbenv but there wasn't
how can i solve this problem
following is what i got error message
thank you
**DEBUG [2814493d] Finished in 3.501 seconds with exit status 0 (successful).
DEBUG [3f8ba0c4] Running /usr/bin/env [ -d ~/.rbenv/plugins/ruby-build ] as
deployer#railserver.cloudapp.net
DEBUG [3f8ba0c4] Command: [ -d ~/.rbenv/plugins/ruby-build ]
DEBUG [3f8ba0c4] Finished in 0.012 seconds with exit status 0 (successful).
DEBUG [243e2a34] Running /usr/bin/env [ -d ~/.rbenv/versions/2.1.2 ] as
deployer#railserver.cloudapp.net
DEBUG [243e2a34] Command: [ -d ~/.rbenv/versions/2.1.2 ]
DEBUG [243e2a34] Finished in 0.009 seconds with exit status 0 (successful).
DEBUG [7a6e00da] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec gem query
--quiet --installed --name-matches ^bundler$ as deployer#railserver.cloudapp.net
DEBUG [7a6e00da] Command: ( PATH=~/.rbenv/shims:~/.rbenv/bin:$PATH RBENV_ROOT=~/.rbenv
RBENV_VERSION=2.1.2 RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec gem query
--quiet --installed --name-matches ^bundler$ )
DEBUG [7a6e00da] bash: /home/deployer/.rbenv/bin/rbenv: No such file or directory
DEBUG [7a6e00da] Finished in 0.009 seconds with exit status 127 (failed).
INFO [d6c3086f] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec gem install
bundler --quiet --no-rdoc --no-ri as deployer#railserver.cloudapp.net
DEBUG [d6c3086f] Command: ( PATH=~/.rbenv/shims:~/.rbenv/bin:$PATH RBENV_ROOT=~/.rbenv
RBENV_VERSION=2.1.2 RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec gem install
bundler --quiet --no-rdoc --no-ri )
DEBUG [d6c3086f] bash: /home/deployer/.rbenv/bin/rbenv: No such file or directory
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployer#railserver.cloudapp.net: gem
exit status: 127
gem stdout: Nothing written
gem stderr: bash: /home/deployer/.rbenv/bin/rbenv: No such file or directory
SSHKit::Command::Failed: gem exit status: 127
gem stdout: Nothing written
gem stderr: bash: /home/deployer/.rbenv/bin/rbenv: No such file or directory
Tasks: TOP => rbenv:install_bundler
(See full trace by running task with --trace)
deployer#railserver:~/rubyonrailstest$ cap aborted!
Stage not set, please call something such as `cap production deploy`, where production is a stage
you have defined.**
I'd recommend capistrano-rbenv-install plugin. It makes problems like the one you have disappear.