小编Jul*_*oro的帖子

被拒绝:将映像推送到 gitlab 注册表时,请求的资源访问被拒绝

我正在尝试将图像推送到 gitlab 注册表。

我已经做过很多次了,所以我想知道为什么会出现这个错误。

我使用最新标签构建图像:

Successfully tagged registry.gitlab.com/mycompany/rgpd_api:latest
Run Code Online (Sandbox Code Playgroud)

然后我登录并推送:

docker login registry.gitlab.com -u gitlab+deploy-token-91931 
docker push registry.gitlab.com/mycompany/rgpd_api:latest
Run Code Online (Sandbox Code Playgroud)

但我得到:

The push refers to repository [registry.gitlab.com/mycompany/rgpd_api]
be679cc302b9: Preparing 
denied: requested access to the resource is denied
Run Code Online (Sandbox Code Playgroud)

我给了gitlab+deploy-token-91931代币read_repositoryread_registry权利。

我的仓库是:

https://gitlab.com/mycompany/rgpd_api
Run Code Online (Sandbox Code Playgroud)

我检查了文档页面:https://docs.gitlab.com/ee/user/project/container_registry.html

但是当我通过 Gitlab CI 执行此操作时,gitlab-ci-token

我可以正常推。

我也尝试重新生成一个新的令牌,但仍然是同样的问题。

我该如何解决它?

registry gitlab docker gitlab-ci

16
推荐指数
1
解决办法
2万
查看次数

Google Play服务已过期.需要4030500但找到3266132

我刚刚做了更新,我不能再执行我的项目了.它说:

10-31 23:23:18.033: W/GooglePlayServicesUtil(28737): Google Play services out of date.  Requires 4030500 but found 3266132

10-31 23:23:18.143: E/AndroidRuntime(28737): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xoco.checker/com.xoco.checker.MainActivity}: java.lang.NullPointerException: CameraUpdateFactory is not initialized
Run Code Online (Sandbox Code Playgroud)

它在30分钟前工作正常,所以我认为更新会导致它.

我已经阅读了类似的问题,但总是使用模拟器,我正在测试三星Galaxy Fame.

我的代码中找不到任何问题.你能帮我么?

编辑: 我在哪里可以找到更新的apk(谷歌播放服务,修订版13)(gms和自动售货机)

android google-play-services

15
推荐指数
1
解决办法
1万
查看次数

属性"barLength"已经定义

我刚刚将Material Design Support Lib更新到v23.0.1,现在,我的代码不再编译了.

Attribute "barLength" has already been defined
/Users/admin/Documents/workspace/MyApp/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml
Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

编辑:

给我错误的2个库是:

compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
Run Code Online (Sandbox Code Playgroud)

android material-design

12
推荐指数
2
解决办法
8003
查看次数

在代理下的dockerfile内部

我正在尝试为elasticsearch-curator构建一个Docker镜像,

这是dockerfile:

FROM alpine:3.7

RUN adduser -S curator

RUN apk add --update \
    python \
    python-dev \
    py-pip \
    build-base \
  && pip install virtualenv \
  && pip install elasticsearch-curator \
  && rm -rf /var/cache/apk/*

USER curator

ENTRYPOINT [ "/usr/bin/curator"]
Run Code Online (Sandbox Code Playgroud)

事情是我在代理下,所以我必须建立我的形象:

docker build  --no-cache --build-arg HTTP_PROXY=http://xx.xx.xx.xx:xx -t elasticsearch-curator:5.4 .
Run Code Online (Sandbox Code Playgroud)

但是当它想要获得virtualenv时,我得到:

Collecting virtualenv
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb8259ed350>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/virtualenv/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection …
Run Code Online (Sandbox Code Playgroud)

python proxy pip docker

12
推荐指数
2
解决办法
6433
查看次数

使用Laravel 5.2进行软删除级联

我正试图在Laravel中实现软删除.

这是我的关系

Tournament ( hasMany ) CategoryTournament (hasOne) CategorySettings
Tournament ( hasMany ) CategoryTournament (belongsToMany) CategoryTournamentUser
Run Code Online (Sandbox Code Playgroud)

所以,我用这个答案帮了我很多忙

现在,当我SoftDelete锦标赛时,所有与之相关的CategoryTournaments也会被删除.

但后来,我尝试递归地应用它,所以我在CategoryTournament模型中编写了相同的代码:

static::deleting(function($categoryTournament) {
        $categoryTournament->settings()->delete();
        $categoryTournament->users()->delete();
    });
Run Code Online (Sandbox Code Playgroud)

但是这段代码从未运行过.我检查了我有设置和用户删除,但没有一个被软删除...

我错过了什么???它应该工作!

编辑:

现在,我正在尝试软删除用户,它只是一个级别:

User (HasMany) Tournament ( hasMany ) CategoryTournament (hasOne) CategorySettings
Run Code Online (Sandbox Code Playgroud)

所以现在,当我软删除用户时,它会删除他的锦标赛,但它不再删除他的CategoryTournaments,所以这不是配置错误.

php soft-delete laravel

11
推荐指数
1
解决办法
7243
查看次数

删除 kubectl 命令返回的标题行

我正在使用 kubernetes,我想从应用程序名称中获取 podname。这是我使用的命令。

POD=$(kubectl get pods -l app=influxdb-local -o custom-columns=:metadata.name -n influx)
Run Code Online (Sandbox Code Playgroud)

然后我想将结果用于:

kubectl exec -it -n influx $POD -- influx -username user -password "user" -execute "CREATE DATABASE db"
Run Code Online (Sandbox Code Playgroud)

但是第一行是空的,第二行包含pod名称,所以第二个命令不起作用。

我应该如何删除第一条白线?

bash kubernetes kubectl

11
推荐指数
1
解决办法
1万
查看次数

使用ListView/RecyclerView中的EditText导航(下一步)

我在RecyclerView里面有EditText(在我有ListView之前,我遇到了同样的问题)

所以每个单元格,我必须填充我的EditText,然后单击下一步以进入下一个EditText.

事情是Next正在为可见行工作.因此,在7行之后,出现按钮Done.

这是绕过它的方法吗?

我尝试过:

android:imeOptions="actionNext"
Run Code Online (Sandbox Code Playgroud)

没有结果

否则,一个好方法应该是每次单击Next时滚动1个元素.有什么办法吗???

TX

android listview android-edittext android-recyclerview

10
推荐指数
1
解决办法
345
查看次数

ANR与Google Analytics

当我尝试使用Google Analytics时,我在尝试使用User-Id时遇到问题:

public class MyApplication extends Application {
    public static GoogleAnalytics analytics;
    public static Tracker tracker;
    @Override
public void onCreate() {
    super.onCreate();
    DatabaseManager.initializeInstance(new DatabaseHandler(this));
    analytics = GoogleAnalytics.getInstance(this);
    analytics.setLocalDispatchPeriod(1800);

    tracker = analytics.newTracker("UA-XXXXXX-2"); // Replace with actual tracker/property Id
    tracker.enableExceptionReporting(true);
    tracker.enableAdvertisingIdCollection(true);
    tracker.enableAutoActivityTracking(true);
}
Run Code Online (Sandbox Code Playgroud)

在我的BaseActivity.java中,我启用了实时报告:

@Override
public void onStart() {
    super.onStart();
    GoogleAnalytics.getInstance(this).reportActivityStart(this);

}
    @Override
    protected void onStop() {
    super.onStop();
    GoogleAnalytics.getInstance(this).reportActivityStop(this);
}
Run Code Online (Sandbox Code Playgroud)

这段代码运行正常.

挑起ANR的代码在我的SplashScreenActivity.java中:

MyApplication.tracker.set("&uid", mUser.userName);
MyApplication.tracker.send(new HitBuilders.EventBuilder().setCategory("UX").setAction("Getting Username").build());
Run Code Online (Sandbox Code Playgroud)

这是ANR的日志

----- pid 14019 at 2015-06-04 16:25:28 -----
Cmd line: com.myapp.mobile

DALVIK THREADS:
(mutexes: tll=0 …
Run Code Online (Sandbox Code Playgroud)

android google-analytics

9
推荐指数
1
解决办法
686
查看次数

我的 docker 映像中不存在供应商文件夹

我正在尝试将我的 Laravel 应用程序的可部署映像构建到 docker 中。

这是我的 dockerfile:

FROM php:7.1.14-fpm
ENV node_version 8.4.0
ENV npm_version 5.7.1

RUN echo "deb http://ftp.de.debian.org/debian stretch main " >> /etc/apt/sources.list \
&& apt-get update -y && apt-get install -y openssl zip unzip git automake \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libmcrypt-dev \
        libpng-dev \
        libmagickwand-dev vim --no-install-recommends \
&& apt-get remove -y libgnutls-deb0-28 \
&& apt-get purge --auto-remove -y g++ \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& …
Run Code Online (Sandbox Code Playgroud)

laravel docker

9
推荐指数
2
解决办法
1148
查看次数

在Jenkins Job中使用ansible-galaxy的凭证和私人gitlab repo

我有一组角色需要安装ansible-galaxy.

- src: 'https://gitlab.private/role-openstack-net.git'
  scm: 'git'
  version: '1.0.0'
  name: 'role-openstack-net'

- src: 'https://gitlab.private/role-openstack-subnet.git'
  scm: 'git'
  version: '1.0.0'
  name: 'role-openstack-subnet'
Run Code Online (Sandbox Code Playgroud)

在实际情况中,我有大约20个角色.

所有角色都是私有的,所以当我运行时:

ansible-galaxy install -f -c -r galaxy.yml
Run Code Online (Sandbox Code Playgroud)

它要求我为每个角色提供用户/通行证,这有点令人烦恼

手动,我这样做:

git config --global credential.helper store
Run Code Online (Sandbox Code Playgroud)

我输入我的凭证一次,然后它会记住它

但是我应该怎样做詹金斯的工作呢?

我在这里看到有一种放置令牌的方法:

https://github.com/ansible/ansible/pull/34621

但它似乎没有用.

任何的想法 ?

git credentials jenkins ansible-galaxy

9
推荐指数
1
解决办法
3034
查看次数