我今天刚刚下载了适用于Windows 10 64bit的Docker Toolbox.我正在阅读教程.尝试使用Dockerfile构建映像时,我收到以下错误.
脚步:
错误:$ docker build -t docker-whale.无法准备上下文:无法评估Dockerfile路径中的符号链接:GetFileAttributesEx C:\ Users\Villanueva\Test\testdocker\Dockerfile:系统找不到指定的文件.
顺便说一句:我试过几个选项@ https://github.com/docker/docker/issues/14339
$ docker info
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 2
Server Version: 1.10.1
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 20
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.1.17-boot2docker
Operating System: Boot2Docker 1.10.1 (TCL 6.4.1); master : b03e158 - Thu …
Run Code Online (Sandbox Code Playgroud) 正在minikube
用于测试部署并正在通过此链接
我的部署清单文件就像
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: webapp
spec:
replicas: 1
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: webapp
imagePullPolicy: Never # <-- here we go!
image: sams
ports:
- containerPort: 80
Run Code Online (Sandbox Code Playgroud)
在此之后,当我尝试执行以下命令时得到输出
user@usesr:~/Downloads$ kubectl create -f mydeployment.yaml --validate=false
deployment "webapp" created
user@user:~/Downloads$ kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
---- -------- ------- ---------- --------- ----
webapp 1 1 1 0 9s
user@user:~/Downloads$ kubectl get pods
NAME READY STATUS RESTARTS AGE …
Run Code Online (Sandbox Code Playgroud) 从编辑器部署到 azure 应用服务时出错。
4:48:55 pm ppdedsrftwu2-appservice1: Starting deployment...
4:48:56 pm ppdedsrftwu2-appservice1: Creating zip package...
4:49:00 pm ppdedsrftwu2-appservice1: Zip package size: 1.09 MB
4:49:04 pm ppdedsrftwu2-appservice1: Fetching changes.
4:49:06 pm ppdedsrftwu2-appservice1: Updating submodules.
4:49:06 pm ppdedsrftwu2-appservice1: Preparing deployment for commit id '2a73dbd291'.
4:49:06 pm ppdedsrftwu2-appservice1: Repository path is /tmp/zipdeploy/extracted
4:49:06 pm ppdedsrftwu2-appservice1: Running oryx build...
4:49:06 pm ppdedsrftwu2-appservice1: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 10 -i /tmp/8d856447f426192 -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log
4:49:07 pm ppdedsrftwu2-appservice1: Operation performed by Microsoft …
Run Code Online (Sandbox Code Playgroud) azure web-deployment reactjs azure-web-app-service azure-appservice
通过docker-compose.yml
我能够运行该应用程序.现在我们要将应用程序移动到生产环境,但我们不想使用容器数据库.那么有什么方法可以将我的本地MySQL数据库与应用程序连接使用docker-compose
?
我的docker-compose.yml看起来像:
version: '3'
services:
web-app:
build:
context: .
dockerfile: web-app/Dockerfile
ports:
- 8080:8080
links:
- app-db
app-db:
build:
context: .
dockerfile: app-db/Dockerfile
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=Optimize
ports:
- 3306:3306
Run Code Online (Sandbox Code Playgroud)
而不是app-db
部分我只想连接到我的本地托管mysql
数据库.
直到几天前,它Dockerfile
都工作正常,当我今天尝试再次构建它时,它在终端中给出以下错误。我尝试使用多个 docker 基础映像,但仍然给出相同的错误。谁能帮我这个?我不认为我错过了什么。如果我错过了,它应该早先给我错误,但为什么现在呢?
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files …
Run Code Online (Sandbox Code Playgroud) 我有如下文件夹结构
.
??? docker-compose.yml
??? web-app
??? create_tomcat_admin.sh
??? Dockerfile
??? pom.xml
??? run.sh
Run Code Online (Sandbox Code Playgroud)
而我docker-compose.yml
的就像
version: '3'
services:
web-app:
build:
context: .
dockerfile: web-app/Dockerfile
ports:
- 8080:8080
network_mode: "host"
Run Code Online (Sandbox Code Playgroud)
一旦我执行docker-compose build
它就会完美地执行并在终端中显示如下
Step 10/15 : ADD /web-app/create_tomcat_admin_user.sh /create_tomcat_admin_user.sh
---> Using cache
---> 6ca9922b3628
Step 11/15 : ADD /web-app/run.sh /run.sh
---> Using cache
---> c1e843f2f67a
Step 12/15 : RUN chmod +x /*.sh
---> Using cache
---> 6b8e781b830c
Step 13/15 : COPY /web-app/target/*.war /tomcat/webapps
---> Using cache
---> fc046d9d1d3e …
Run Code Online (Sandbox Code Playgroud) 面临着奇怪的问题。当我Dockerfile
在Windows机器(Laptop)上构建我的计算机时,出现以下错误,并且尝试在上部署时也出现相同的错误Azure DevOps
。
Step 7/17 : COPY ["WebApp.csproj", ""]
---> 3f3e198d00aa
Step 8/17 : RUN dotnet restore "/WebApp.csproj"
---> Running in 51f16f947ffb
MSBUILD : error MSB1001: Unknown switch.
Switch: /WebApp.csproj
For switch syntax, type "MSBuild -help"
The command '/bin/sh -c dotnet restore "/WebApp.csproj"' returned a non-zero code: 1
PS C:\Users\user\Desktop\Directory>
Run Code Online (Sandbox Code Playgroud)
但是,Dockerfile
当我们使用Visual Studio构建它并开始运行而没有任何错误时,同样可以正常工作。
Docker文件如下所示:
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY ["WebApp.csproj", ""]
RUN …
Run Code Online (Sandbox Code Playgroud) 我正在浏览一些链接以在 azure 应用程序服务上部署 React Js 应用程序。但是我在部署应用程序时遇到了一些问题。
我已经添加了所有必要的东西,比如web.config
文件到public
文件夹,并将构建目录添加到工作区。
使用 Visual Studio Code 将 Node.js 部署到 Azure 应用服务
遵循所有步骤,但当我尝试在 azure 应用服务上部署时出现以下错误。在部署之前,我会运行这些命令
npm run build
.
2020-08-19T10:44:45.762075166Z A P P S E R V I C E O N L I N U X
2020-08-19T10:44:45.762079567Z
2020-08-19T10:44:45.762083667Z Documentation: http://aka.ms/webapp-linux
2020-08-19T10:44:45.762088167Z NodeJS quickstart: https://aka.ms/node-qs
2020-08-19T10:44:45.762092268Z NodeJS Version : v12.16.3
2020-08-19T10:44:45.762096468Z Note: Any data outside '/home' is not persisted
2020-08-19T10:44:45.762100768Z
2020-08-19T10:44:45.789282727Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. …
Run Code Online (Sandbox Code Playgroud) azure node.js reactjs azure-web-app-service azure-appservice
docker ×6
dockerfile ×4
azure ×2
reactjs ×2
asp.net ×1
azure-devops ×1
dockerhub ×1
kubectl ×1
kubernetes ×1
minikube ×1
mysql ×1
node.js ×1