docker容器内没有基本的vi命令,也没有yum,apt-get好像权限不够,怎么操作呢!?

jenkins@6ea9ec88cdfd:~/maven/apache-maven-3.6.0/conf$ ls
logging settings.xml toolchains.xml
jenkins@6ea9ec88cdfd:~/maven/apache-maven-3.6.0/conf$ vi settings.xml
bash: vi: command not found
jenkins@6ea9ec88cdfd:~/maven/apache-maven-3.6.0/conf$ apt
apt apt-cache apt-cdrom apt-config apt-get apt-key apt-mark

jenkins@6ea9ec88cdfd:~/maven/apache-maven-3.6.0/conf$ apt-get update
Reading package lists... Done
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
jenkins@6ea9ec88cdfd:~/maven/apache-maven-3.6.0/conf$

2个回答

E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
权限问题啊

容器启动时加参数--privileged=false 试试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于Docker虚拟机中安装使用vi/vim命令及apt-get update命令的疑问

1. Docker虚拟机中并没有vi/vim命令,所以无法编辑文件 2. 安装vi/vim命令需要使用 apt-install 命令 3. Docker虚拟机使用apt-install安装软件需要先apt-get update 4. apt-get update命令执行异常缓慢,需要修改镜像文件/etc/apt/sources.list 5. 修改文件需要用到vi/vim命令 然后…… 1、2、3、4、5、1、2、3、4、5……这就陷入死循环了怎么破?

Dockerfile Image命令'/ bin / sh -c apt-get install -y mysqld-server'返回非零代码:100

<div class="post-text" itemprop="text"> <p>I want to make a docker image with this spec:</p> <ol> <li>Ubuntu : 16.04 / Latest</li> <li>PHP 7.x</li> <li>nginx : Latest mySQL 5.x</li> <li>Expose Port 80 &amp; 443 </li> <li>Directory / Source</li> </ol> <p>Optional :</p> <ol> <li>VIM</li> <li>PHP Composer</li> </ol> <p>My Dockerfile:</p> <pre><code># Download base image ubuntu 16.04 FROM ubuntu:16.04 # Update Ubuntu Software repository RUN apt-get update # Install PHP, nginx, mySQL RUN apt-get install -y nginx php7.0-fpm &amp;&amp; \ rm -rf /var/lib/apt/lists/* # Install MySQL and set default root password RUN echo 'mysql-server mysql-server/root_password password mypassword' | debconf-set-selections RUN echo 'mysql-server mysql-server/root_password_again password mypassword' | debconf-set-selections RUN apt-get install -y mysql-server # Define the ENV variable ENV nginx_vhost /etc/nginx/sites-available/default ENV php_conf /etc/php/7.0/fpm/php.ini ENV nginx_conf /etc/nginx/nginx.conf # Enable php-fpm on nginx virtualhost configuration COPY default ${nginx_vhost} RUN sed -i -e 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' ${php_conf} &amp;&amp; \ echo " daemon off;" &gt;&gt; ${nginx_conf} RUN mkdir -p /run/php &amp;&amp; \ chown -R www-data:www-data /var/www/html &amp;&amp; \ chown -R www-data:www-data /run/php # Volume configuration VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] # Configure Services and Port COPY start.sh /start.sh CMD ["./start.sh"] EXPOSE 80 443 </code></pre> <p>I get this error message when I built it</p> <pre><code>Sending build context to Docker daemon 5.632 kB Step 1 : FROM ubuntu:16.04 ---&gt; 2d696327ab2e Step 2 : RUN apt-get update ---&gt; Using cache ---&gt; b58709c2b7b9 Step 3 : RUN apt-get install -y nginx php7.0-fpm &amp;&amp; rm -rf /var/lib/apt/lists/* ---&gt; Using cache ---&gt; 3d58b4fac924 Step 4 : RUN echo 'mysql-server mysql-server/root_password password mypassword' | debconf-set-selections ---&gt; Using cache ---&gt; 85256efe3bd3 Step 5 : RUN echo 'mysql-server mysql-server/root_password_again password mypassword' | debconf-set-selections ---&gt; Using cache ---&gt; d1f71eeacbe2 Step 6 : RUN apt-get install -y mysqld-server ---&gt; Running in 9dba6ce0c59a Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package mysqld-server The command '/bin/sh -c apt-get install -y mysqld-server' returned a non-zero code: 100 </code></pre> <p>How can I fix it?</p> <p>Thanks</p> </div>

apt-get 安装php-pear时 为何提示其他软件更新,

root@dev:/# sudo apt-get install php-pear Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libcupsimage2 libmagickcore3 libjbig2dec0 libmagickwand3 liblqr-1-0 libt1-5 libgs8 ghostscript libpaper-utils gsfonts libpaper1 Use 'apt-get autoremove' to remove them. The following extra packages will be installed: dpkg fontconfig-config libdb5.1 libfontconfig1 libgd2-xpm libjpeg8 libltdl7 liblzma5 libmysqlclient18 libpcre3 libssl1.0.0 libtinfo5 libxml2 multiarch-support mysql-common php5-cgi php5-cli php5-common php5-curl php5-fpm php5-gd php5-imap php5-mcrypt php5-mysql psmisc Suggested packages: libgd-tools php5-dev The following packages will be REMOVED: libgd2-noxpm php5-apc php5-imagick php5-memcache php5-redis php5-suhosin The following NEW packages will be installed: libdb5.1 libgd2-xpm libjpeg8 liblzma5 libmysqlclient18 libssl1.0.0 libtinfo5 multiarch-support php-pear The following packages will be upgraded: dpkg fontconfig-config libfontconfig1 libltdl7 libpcre3 libxml2 mysql-common php5-cgi php5-cli php5-common php5-curl php5-fpm php5-gd php5-imap php5-mcrypt php5-mysql psmisc 17 upgraded, 9 newly installed, 6 to remove and 426 not upgraded. Need to get 15.2 MB/20.2 MB of archives. After this operation, 7,879 kB of additional disk space will be used. Do you want to continue [Y/n]? Y 怎么能只安装 php-pear 呢?

docker虚拟机中,使用网上教程加速apt-get源镜像,更新sources.list文件后执行apt-get update命令报错:The following signatures couldn't be verified because the public key is not available

是在docker虚拟机中运行的命令 Err:1 http://mirrors.ustc.edu.cn/ubuntu xenial InRelease Connection failed [IP: 202.38.95.110 80] Get:2 http://mirrors.ustc.edu.cn/ubuntu xenial-security InRelease [109 kB] Err:2 http://mirrors.ustc.edu.cn/ubuntu xenial-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY xxx NO_PUBKEY zzz Get:3 http://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease [109 kB] Err:3 http://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY xxx NO_PUBKEY zzz Get:4 http://mirrors.ustc.edu.cn/ubuntu xenial-proposed InRelease [260 kB] Err:4 http://mirrors.ustc.edu.cn/ubuntu xenial-proposed InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY xxx NO_PUBKEY zzz Get:5 http://mirrors.ustc.edu.cn/ubuntu xenial-backports InRelease [107 kB]

debian下 apt-update失败

![说明](https://img-ask.csdn.net/upload/201709/10/1505017388_623462.png) 最近开始学习linux 我在尝试使用man时,遇到了一个问题 commond not found 经过搜索得知,需要安装man apt-get install man 结果报错:unable to locate the package man 网络上给的建议是apt-get update 但是又遇到了问题,通过一些帖子的方法(改dns),依旧没解决 希望得到各位的帮助,下图是update的结果 ![图片说明](https://img-ask.csdn.net/upload/201709/10/1505017712_253582.png)

Ubuntu 输入 apt-get update , 产生Hash Sum mismatch

[root]$ sudo apt-get update W: Failed to fetch http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/dists/trusty/main/binary-i386/Packages Hash Sum mismatch W: Failed to fetch http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/dists/trusty/main/i18n/Translation-en Hash Sum mismatch E: Some index files failed to download. They have been ignored, or old ones used instead.

docker ce 注册apt源时遇到问题

今天尝试安装docker最新社区版,在注册官方安装源的时候遇到问题。 按官方文档所述,已经安装好apt的https模块,下载并验证了证书。执行如下语句注册官方源 > sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" 执行后,/etc/apt/source.list如下: > …… deb [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable \# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable …… 此时执行更新命令apt-get update,报如下异常 > …… Ign https://download.docker.com trusty InRelease Ign https://download.docker.com trusty Release.gpg Ign https://download.docker.com trusty Release Err https://download.docker.com trusty/stable amd64 Packages Bad header line Ign https://download.docker.com trusty/stable Translation-en_US Ign https://download.docker.com trusty/stable Translation-en Fetched 68.8 MB in 2min 0s (574 kB/s) W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/trusty/stable/binary-amd64/Packages Bad header line E: Some index files failed to download. They have been ignored, or old ones used instead. 清除缓存(rm -Rf /var/lib/apt/lists/\*)后再次执行更新依然是上述异常。 谁有过类似问题解决经历或者解决思路,请不吝赐教!

docker容器中,主机可以ping通虚拟机,但是ping不通docker容器

最近研究docker容器发现几个问题有几点疑惑: 1.首先自己的ISO文件打成tar包后导如容器中,防火墙fiter、nat表丢失,启动也启动不了,百度能查到的基本都试了,貌似没什么用,而且虚拟机还ping不通docker地址; 2.我想把mysql、java之类的放在一个镜像容器中,从仓库中检索了一个centos6系统出来,发现这次mysql也连接不上,ping了一下,虚拟机和docker能互通(不同网段),主机和虚拟机能互通(同一网段内),结果就是主机ping不通docker容器,防火墙之类的已关闭,路由表也书写了,愣是通不了

Gitlab Ci使用docker和mysql服务进行缓慢构建

<div class="post-text" itemprop="text"> <p>I´m using gitlab-ci-multirunner 9.3.0 and the GitLab Community Edition 9.3.5</p> <p>When i´m running my php-unit test on my local virtual box environment, the total test (30) just need about:</p> <pre><code>Time: 5 minutes, Memory: 96.00MB </code></pre> <p>Running the same tests on my gitlab host, it needs a total of</p> <pre><code>Time: 41.68 minutes, Memory: 97.75MB </code></pre> <p>The tests require mysql and do a database create and fixture load on each test. </p> <p>My DockerFile:</p> <pre><code>FROM tetraweb/php:5.6 # Install additional packages RUN apt-get clean &amp;&amp; apt-get -qq update RUN apt-get -qq upgrade -y RUN apt-get install -qq -y apt-utils RUN apt-get install -qq -y mysql-client libmagickwand-dev libgeoip-dev -y --no-install-recommends RUN pecl install imagick apcu-4.0.11 geoip RUN docker-php-ext-enable exif gd gettext intl mcrypt mysql mysqli opcache pdo_mysql zip memcache apcu imagick geoi </code></pre> <p>my gitlab-ci.yml:</p> <pre><code>variables: TIMEZONE: Europe/Berlin MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: test-root MYSQL_USER: test MYSQL_PASSWORD: asecurething SYMFONY_ENV: "test" stages: - test - deploy test: image: test-image-php:5.6 services: - mariadb:latest stage: test only: - branches except: - master script: - export COMPOSER_CACHE_DIR=x/cache/composer - SYMFONY_ENV=test composer install --no-progress --no-interaction - chmod +x bin/console - php vendor/phpunit/phpunit/phpunit --coverage-text --colors=never </code></pre> <p>I really think thats the mysql service fault who creates the big difference. Whats the best way to increase the performance of my phpunit tests?</p> </div>

用docker镜像搭建的jenkins,构建时使用shell脚本,没有root权限,该怎么办。

这是我在jenkins里面写的构建脚本 ``` docker -v if [ $? != 0 ] then apt-get update apt-get install docker fi docker rm -f biz-document docker rmi -f comb-service-biz-document-imnage docker build -t comb-service-biz-document-imnage ./comb-service-biz-document/ docker run -d -p 2000:2000 --name biz-document comb-service-biz-document-imnage ``` 这是构建时候的日志输出 ``` + docker -v /tmp/hudson1357047080350557192.sh: 2: /tmp/hudson1357047080350557192.sh: docker: not found Build step 'Execute shell' marked build as failure Finished: FAILURE ``` 原本我是打算,判断一下docker是否安装,没有安装就apt-get install一个 结果现在遇到两个问题: 1.这个判断写法好像不对 2.因为我这个jenkins是一个docker的镜像,docker exec -ti 6cb7 whoami看了下不是root用户,是jenkins用户,我没法获取到root权限,也就不能apt-get了 小白一枚,望大神赐教。

如何在docker容器中重新加载服务配置(php-fpm)?

<div class="post-text" itemprop="text"> <p>I need to run php-fpm with root user.</p> <p>I'm following steps on this page <a href="https://serverfault.com/a/789039/479680">Start PHP-FPM with root option automatically</a> but it looks like systemd and systemctl are not inluded in my baseimage ubuntu:16.04 then I can't reload service configuration.</p> <p>Then how to proceed else ? Today, i'm installing apache/php-fpm in the same container.</p> <p>Thanks in advance.</p> <p>Dockerfile :</p> <p></p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>FROM ubuntu:16.04 # Installer Nano / Apache2 RUN apt-get update &amp;&amp; apt-get install -y \ apt-utils \ nano \ apache2 # Activer le module Apache mod_proxy_fcgi RUN a2enmod proxy_fcgi # Activer le module Apache mod_rewrite RUN a2enmod rewrite # Installation PHP + extensions / composer RUN apt-get install -y \ php-fpm \ php-mcrypt \ php-mysql \ php-apcu \ php-curl \ php-intl \ php-xdebug \ php-xml \ php-zip \ php-bcmath \ php-gd \ php-json \ php-ldap \ php-mbstring \ php-mysql \ php-pgsql \ php-sqlite3 \ php-xml \ php-xsl \ php-zip \ php-soap \ php-opcache \ composer # Creation dossier php pour pid/socket php-fpm RUN mkdir /run/php # Activer config RUN a2enconf php7.0-fpm EXPOSE 80 VOLUME /var/www/html WORKDIR /var/www/html # Clean up APT when done. RUN apt-get clean</code></pre> </div> </div> <p>My docker-compose file :</p> <p></p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>version: '2' services: apachephp: container_name: monserveur image: toto/apache2_php-fpm7.0.30:0.4 ports: - "80:80" volumes: - D:\projets\lab.magento225:/var/www/html links: - db:db tty: true db: container_name: mabdd image: mysql:5.6 ports: - "3306:3306" volumes: - D:\local.databases\lab.magento225:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=root pma: container_name: phpmyadmin image: phpmyadmin/phpmyadmin ports: - "8080:80" links: - db:db</code></pre> </div> </div> </div>

docker容器中service命令不可用

docker容器中service命令不可用 systemctl命令也不可用,怎样才能使用这两个命令中的一个呢 容器的竟像是centos

ubuntu 12.04 apt-get 安装报错

Ubuntu 12.04版 使用apt-get安装memcached的时候后面会报这样的错误 insserv: warning: script 'atd' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `atd' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `atd' insserv: warning: script 'rsyslog' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `rsyslog' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `rsyslog' insserv: warning: script 'ufw' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `ufw' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `ufw' insserv: warning: script 'udevmonitor' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udevmonitor' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `udevmonitor' insserv: warning: script 'network-interface-container' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `network-interface-container' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `network-interface-container' insserv: warning: script 'dmesg' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `dmesg' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `dmesg' insserv: warning: script 'dbus' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `dbus' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `dbus' insserv: warning: script 'resolvconf' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `resolvconf' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `resolvconf' insserv: warning: script 'udev' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `udev' insserv: warning: script 'passwd' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `passwd' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `passwd' insserv: warning: script 'udev-finish' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev-finish' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `udev-finish' insserv: warning: script 'network-interface-security' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `network-interface-security' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `network-interface-security' insserv: warning: script 'hostname' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hostname' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `hostname' insserv: warning: script 'module-init-tools' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `module-init-tools' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `module-init-tools' insserv: warning: script 'cron' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `cron' insserv: warning: script 'setvtrgb' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `setvtrgb' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `setvtrgb' insserv: warning: script 'udevtrigger' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udevtrigger' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `udevtrigger' insserv: warning: script 'procps' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `procps' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `procps' insserv: warning: script 'irqbalance' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `irqbalance' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `irqbalance' insserv: warning: script 'friendly-recovery' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `friendly-recovery' insserv: warning: script 'network-interface' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `network-interface' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `network-interface' insserv: warning: script 'hwclock-save' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hwclock-save' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `hwclock-save' insserv: warning: script 'hwclock' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hwclock' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `hwclock' insserv: warning: script 'console-setup' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `console-setup' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `console-setup' insserv: warning: script 'udev-fallback-graphics' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev-fallback-graphics' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `udev-fallback-graphics' 请牛人解答

给docker起名字并进入容器的命令中-it的意义

给docker起名字并进入容器: docker run --name mydocker -it centos /bin/bash 其中-it是什么意思

如何解决使用yum无法安装containuer-selinux、docker的问题?

## 1. 最近准备在linux上安装docker,而安装docker之前就需要安装container-selinux、selinux-policy ![图片说明](https://img-ask.csdn.net/upload/201905/05/1557042666_31883.png) ## 2.尝试过像网上所说(https://blog.csdn.net/qq_41772936/article/details/81080284) 的将tencent的镜像、源换成aliyun,但执行yum makecache命令就一直Trying other mirror.用yum安装container-selinux,出现了以前一样的问题。 ![图片说明](https://img-ask.csdn.net/upload/201905/05/1557043170_982023.png) ## 3 .看网上的教程多次修改过centos-base.repo和centos-epel.repo文件,频繁的更换yum源,很怀疑是因为yum的配置文件修改有误才导致的一系列问题。因为卸载并重装过yum还是出现同样的问题。 ## ![图片说明](https://img-ask.csdn.net/upload/201905/05/1557043399_214872.png) ![图片说明](https://img-ask.csdn.net/upload/201905/05/1557043516_409194.png) ## 所以问一下大佬们如何修改配置文件或者使用什么yum源来顺利安装container-selinx和docker(也不懂Linux系统里是怎么处理各种软件安装包的……)

Docker容器崩溃-之后管理容器出现问题

<div class="post-text" itemprop="text"> <p>I run:</p> <ul> <li>docker: Docker version 17.03.0-ce, build 60ccb22</li> <li>linux: Ubuntu 16.04.2 LTS</li> </ul> <p>Image inside docker container runs some golang app, which (I found this know) wasn't properly dealing with errors. I should include os.Exit(1) for cases like mine, for error checking.</p> <p>I run/start docker container with command like</p> <p><code> docker run -it --restart=always --env-file ~/PRODUCTION/services/resolvment_api/.environmet_variables -p 8081:3003 --name resolvment_2 -d resolvment-api </code></p> <p>Ok, then it looks like an error occur inside a docker container on app level. At this point something strange happens to docker/docker container. </p> <p>If i do <code>docker ps</code> I can see </p> <p><code>2e7b02258647 resolvment-api "/bin/sh -c $GOBIN..." 9 days ago Up 37 hours 0.0.0.0:8081-&gt;3003/tcp resolvment_2 </code></p> <ol> <li><p>I can do <code>docker logs 2e7b02258647</code> and will see logs. </p></li> <li><p>If I try to do <code>docker stop 2e7b02258647</code> I get container id in next line as usually when you successfully stop a container. Then if i do <code>docker ps</code> again... I can still see docker container (with same id) listed there?!</p></li> <li><p>If I then try to forcefully remove the container with <code>docker rm -f 2e7b02258647</code> I get an error <code>Error response from daemon: Unable to remove filesystem for 2e7b02258647ec357fd1beb0083ad678eb381474f1315b3e524d318472c5f061: remove /var/lib/docker/containers/2e7b02258647ec357fd1beb0083ad678eb381474f1315b3e524d318472c5f061/shm: device or resource busy </code> but docker container is not listed anymore under <code>docker ps</code>.</p></li> <li><p>Then I want to add/start again the container with command <code>docker run -it --restart=always --env-file ~/PRODUCTION/services/resolvment_api/.enviroment_variables -p 8081:3003 --name resolvment_2 -d resolvment-api</code></p></li> </ol> <p>and the error that i get as response is this: <code>fc174f65cc34a2573563729acfe11436370ab08965be553e682d82e7af06b236 docker: Error response from daemon: service endpoint with name resolvment_2 already exists.</code></p> <p>so i do <code>docker rm resolvment_2</code>, and try to start again... but same error. </p> <p>if i put -f with rm command... doesn't help either. </p> <p>So, rm/run/rm/run.... walking in circle... doesn't help. </p> <p>And I can't just restart docker daemon, since there are few other containers running. </p> <p>Would really aprechiate some help on this. </p> <p>Best, Tomaz</p> </div>

为什么我的Dockerfile没有执行命令

<div class="post-text" itemprop="text"> <p>I'm trying to dockerise my Laravel app.</p> <p>Here is my dockerfile:</p> <pre><code>FROM php:7.1.14-fpm WORKDIR /app COPY . /app COPY ./entrypoint.sh /tmp RUN touch /app/resources/assets/less/_main_full/main.less \ &amp;&amp; touch /app/database.sqlite \ &amp;&amp; apt-get update -y &amp;&amp; apt-get install -y openssl zip unzip git npm \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ libmagickwand-dev --no-install-recommends \ sqlite3 libsqlite3-dev \ &amp;&amp; apt-get purge --auto-remove -y g++ \ &amp;&amp; apt-get clean \ &amp;&amp; rm -rf /var/lib/apt/lists/* \ &amp;&amp; docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ &amp;&amp; docker-php-ext-install pdo pdo_mysql mbstring zip -j$(nproc) iconv mcrypt -j$(nproc) gd \ &amp;&amp; curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash \ &amp;&amp; export NVM_DIR="$HOME/.nvm" \ &amp;&amp; [ -s "$NVM_DIR/nvm.sh" ] &amp;&amp; \. "$NVM_DIR/nvm.sh" # This loads nvm \ &amp;&amp; nvm install node \ &amp;&amp; npm cache clean -f &amp;&amp; npm install -g n &amp;&amp; n stable &amp;&amp; npm install cross-env &amp;&amp; npm install &amp;&amp; npm run dev \ &amp;&amp; curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ &amp;&amp; composer install --no-interaction \ &amp;&amp; chown -R www-data:www-data \ /app/storage \ /app/bootstrap/cache \ &amp;&amp; chmod 755 /tmp/entrypoint.sh CMD ["/tmp/entrypoint.sh"] </code></pre> <p>When I build it with:</p> <pre><code>docker build -f laravel-local.dockerfile . --no-cache </code></pre> <p>I get this output: </p> <pre><code>... export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] &amp;&amp; \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] &amp;&amp; \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion Removing intermediate container 642a7d7f4a59 ---&gt; 5121a6997e87 Step 6/6 : CMD ["/tmp/entrypoint.sh"] ---&gt; Running in 7f7468684e00 Removing intermediate container 7f7468684e00 ---&gt; df2ee7652870 Successfully built df2ee7652870 </code></pre> <p>I don't understand why isn't it executing all the composer and chown instructions</p> </div>

docker 容器内系统启动顺序是怎么样的?

命令是这样的: ``` docker run -d -it -p 8888:7410 --name zseCon1 -h zseCon1 --net=net1 --ip 172.20.0.120 -e tokenId=123456 -v /zseShare:/soft --privileged --restart=always centos7 /usr/sbin/init ``` 然后容器内部有一个脚本run.sh 是根据传入的 tokenId 搞事情的... 有一行代码是 echo "tokenId: $tokenId" >> token.txt 然后我再 /etc/rc.local 最后一行添加了 sh /run.sh 但是 $tokenId 取不到值.... 我确定 run.sh 开机自动运行的 因为其它逻辑都执行了 只有这个环境变量取不到.... 而且 $HOSTNAME 这种环境变量是取得到的... 但是 exec 到容器里面 运行一下 sh /etc/rc.loacl 又他妈可以取到 $tokenId 我怀疑是启动顺序问题 应该是rc.local 先于docekr -e 设置环境变量执行了...但是 我不知道应该把我的 run.sh 放到哪里自启动才能读取到 $tokenId

Docker:E:无法找到包mysql-client --no-install-recommended

<div class="post-text" itemprop="text"> <p>I'm following this tutorial: <a href="https://medium.com/@phillipmarkpadilla/laravel-5-6-in-docker-with-php-7-2-nginx-1-10-and-mysql-5-7-cdb6c054379c" rel="nofollow noreferrer">Laravel 5.6 in Docker with PHP 7.2, NGINX 1.10 and MySQL 5.7</a></p> <p>Which is basically an update of this: <a href="https://medium.com/@shakyShane/laravel-docker-part-1-setup-for-development-e3daaefaf3c" rel="nofollow noreferrer">Laravel + Docker Part 1 — setup for Development</a></p> <p>But when I ran </p> <pre><code>docker-compose up </code></pre> <p>I got this error</p> <pre><code>E: Unable to locate package mysql-client —-no-install-recommends ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update &amp;&amp; apt-get install -y mysql-client —-no-install-recommends &amp;&amp; docker-php-ext-install pdo_mysql' returned a non-zero code: 100 </code></pre> <p>A full output </p> <pre><code>Creating network "pulzu_default" with the default driver Building app Step 1/2 : FROM php:7.2.2-fpm ---&gt; 60245f64ed12 Step 2/2 : RUN apt-get update &amp;&amp; apt-get install -y mysql-client —-no-install-recommends &amp;&amp; docker-php-ext-install pdo_mysql ---&gt; Running in cefd70564b31 Get:1 http://security.debian.org stretch/updates InRelease [94.3 kB] Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease Get:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB] Get:5 http://security.debian.org stretch/updates/main amd64 Packages [468 kB] Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB] Get:6 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B] Get:7 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [12.1 kB] Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [9530 kB] Fetched 10.3 MB in 2s (4142 kB/s) Reading package lists... Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package mysql-client —-no-install-recommends ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update &amp;&amp; apt-get install -y mysql-client —-no-install-recommends &amp;&amp; docker-php-ext-install pdo_mysql' returned a non-zero code: 100 </code></pre> <p>Does anyone have any idea how to fix it?</p> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java校招入职华为,半年后我跑路了

何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

@程序员:GitHub这个项目快薅羊毛

今天下午在朋友圈看到很多人都在发github的羊毛,一时没明白是怎么回事。 后来上百度搜索了一下,原来真有这回事,毕竟资源主义的羊毛不少啊,1000刀刷爆了朋友圈!不知道你们的朋友圈有没有看到类似的消息。 这到底是啥情况? 微软开发者平台GitHub 的一个区块链项目 Handshake ,搞了一个招募新会员的活动,面向GitHub 上前 25万名开发者派送 4,246.99 HNS币,大约价...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

win10暴力查看wifi密码

刚才邻居打了个电话说:喂小灰,你家wifi的密码是多少,我怎么连不上了。 我。。。 我也忘了哎,就找到了一个好办法,分享给大家: 第一种情况:已经连接上的wifi,怎么知道密码? 打开:控制面板\网络和 Internet\网络连接 然后右击wifi连接的无线网卡,选择状态 然后像下图一样: 第二种情况:前提是我不知道啊,但是我以前知道密码。 此时可以利用dos命令了 1、利用netsh wlan...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

立即提问
相关内容推荐